Fork of patreon's fox generator
- JavaScript 100%
| js | ||
| test | ||
| .gitignore | ||
| circle.yml | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| run.js | ||
| server.js | ||
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