Fork of patreon's fox generator
  • JavaScript 100%
Find a file
2026-05-09 00:15:06 -07:00
js Deprecate v1 urls, upgraded things 2018-10-19 14:29:06 -07:00
test Handle Etag and If-none-match headers and 304 responses 2018-10-22 11:41:29 -07:00
.gitignore Make the server work. 2016-12-15 12:20:41 -08:00
circle.yml Linting with "test" 2017-06-12 18:42:24 -07:00
LICENSE Add MIT License. 2016-12-21 19:13:55 -08:00
package-lock.json Updates all major dependencies, remove datadog integration. 2023-11-12 14:47:06 -08:00
package.json Updates all major dependencies, remove datadog integration. 2023-11-12 14:47:06 -08:00
README.md commit 2026-05-09 00:15:06 -07:00
run.js Updates all major dependencies, remove datadog integration. 2023-11-12 14:47:06 -08:00
server.js Updates all major dependencies, remove datadog integration. 2023-11-12 14:47:06 -08:00

Foxy Moxy

A procedurally generated fox avatar service. Given a seed string, it deterministically renders a unique fox face as a PNG — same seed always produces the same fox.

API

GET /:width/:seed   → PNG image, max 400×400px
GET /2/:width/:seed → same (v2 route alias)
GET /healthcheck    → 200 OK

Example: GET /200/my-unique-seed returns a 200×200 PNG of the fox associated with my-unique-seed.

Seeds are sanitized filenames, so any URL-safe string works. The response includes ETag-based caching (30-day Cache-Control).

Setup

Prerequisites

The canvas package requires Cairo:

macOS

brew install cairo

Debian / Ubuntu

sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev

Install & run

npm install
node run.js

The server starts on port 3000 by default. Set PORT to override.

Environment variables

Variable Description
PORT HTTP port (default: 3000)
SENTRY_DSN Sentry DSN for error tracking

Development

npm test   # run mocha tests
npm run lint  # standard style lint

License

MIT