A scuffed website to display random pictures of random cats of people who contribute to it. No NFTs... yet.
Find a file
2023-10-31 10:53:01 +00:00
.github/workflows CI: goreleaser 2023-10-27 10:55:04 +03:00
images Delete images/20231009_035703.jpg 2023-10-31 10:53:01 +00:00
vendor chore: tidy 2023-10-27 11:49:51 +03:00
.dockerignore everyone likes docker 2022-01-25 16:21:52 +03:00
.envrc feat: nix tooling 2023-10-26 19:39:06 +03:00
.gitattributes docs: update usage instructions 2023-10-27 10:48:26 +03:00
.gitignore ignore build artifacts 2023-10-27 10:53:42 +03:00
config.yaml restructure config 2023-10-27 10:30:34 +03:00
default.nix feat: nix tooling 2023-10-26 19:39:06 +03:00
docker-compose.yml everyone likes docker 2022-01-25 16:21:52 +03:00
Dockerfile everyone likes docker 2022-01-25 16:21:52 +03:00
flake.lock feat: nix tooling 2023-10-26 19:39:06 +03:00
flake.nix feat: nix tooling 2023-10-26 19:39:06 +03:00
go.mod chore: tidy 2023-10-27 11:49:51 +03:00
go.sum chore: tidy 2023-10-27 11:49:51 +03:00
LICENSE we license these 2022-01-25 02:09:14 +03:00
main.go use /api/random endpoint for fetching images 2023-10-27 10:30:13 +03:00
README.md docs: update usage instructions 2023-10-27 10:48:26 +03:00
shell.nix feat: nix tooling 2023-10-26 19:39:06 +03:00
test.sh rewrite in go 2023-10-27 10:01:55 +03:00

🐾 catApi

catApi is a minimal, self-hostable API endpoint for serving pictures of, you guessed it, cats! but it could be used to serve anything, really

Usage

There are two ways to "use" catApi - you can either serve it, blessing the world with pictures of your cat or be served. Below is the API documentation for visiting an existing instance of catApi.

API Documentation

catApi exposes several endpoints.

ID

/api/id will return the image with the associated ID.

For example http://localhost:3000/api/id?id=3 will return the image with the ID of "3".

List

/api/list will return eturn a JSON object containing data about the images within the /images directory

For example, http://localhost:3000/api/random will return a JSON object that might be as follows

[{"id":"0","url":"/api/id?id=0"},{"id":"1","url":"/api/id?id=1"},{"id":"2","url":"/api/id?id=2"}]

Random

/api/random will return a random image from the list of available images

Self-hosting

TODO

License

catApi is licensed under the MIT license.