{"id":13791843,"url":"https://github.com/itsthatguy/avatars-api-middleware","last_synced_at":"2025-04-12T23:39:30.487Z","repository":{"id":16898443,"uuid":"19659273","full_name":"itsthatguy/avatars-api-middleware","owner":"itsthatguy","description":"The express middleware for our avatars service","archived":false,"fork":false,"pushed_at":"2023-03-01T19:26:18.000Z","size":4328,"stargazers_count":749,"open_issues_count":15,"forks_count":98,"subscribers_count":40,"default_branch":"develop","last_synced_at":"2025-04-12T23:39:24.893Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itsthatguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-05-11T05:25:46.000Z","updated_at":"2025-04-04T13:33:16.000Z","dependencies_parsed_at":"2024-07-30T07:54:57.044Z","dependency_job_id":null,"html_url":"https://github.com/itsthatguy/avatars-api-middleware","commit_stats":{"total_commits":269,"total_committers":15,"mean_commits":"17.933333333333334","dds":"0.44981412639405205","last_synced_commit":"89f269b349e6039f9579b403679a249c2e8fdcd9"},"previous_names":["adorableio/adorable-avatars"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsthatguy%2Favatars-api-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsthatguy%2Favatars-api-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsthatguy%2Favatars-api-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsthatguy%2Favatars-api-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsthatguy","download_url":"https://codeload.github.com/itsthatguy/avatars-api-middleware/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647255,"owners_count":21139081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T22:01:05.127Z","updated_at":"2025-04-12T23:39:30.461Z","avatar_url":"https://github.com/itsthatguy.png","language":"TypeScript","funding_links":[],"categories":["Adorable Avatars","TypeScript"],"sub_categories":[],"readme":"# adorable-avatars\n[![Build Status](https://travis-ci.org/adorableio/avatars-api-middleware.svg)](https://travis-ci.org/adorableio/avatars-api-middleware)\n\n## What is it?\nThis repository contains the [express middleware](https://expressjs.com/en/guide/using-middleware.html#middleware.router) that can be used to host your own avatars service!\n\nCheck out [our website](http://avatars.adorable.io/) for more info on (and an interactive demo of) what this service does.\n\n## How do I use it?\nFirst, you'll need the `adorable-avatars` package:\n\n```bash\nnpm install adorable-avatars --save\n```\n\nThen, use the router middleware within your application:\n\n```js\n// your_server.js\nimport express from 'express';\nimport avatarsMiddleware from 'adorable-avatars';\n\nconst myApp = express();\nmyApp.use('/myAvatars', avatarsMiddleware);\n```\n\nThat's it! Your server now includes the avatars endpoints!\n\n### Endpoints\nAssuming your server lives at `myserver.com`, and you've configured the middleware as above, you now have the following endpoints:\n\n* `myserver.com/myAvatars/:id`\n    * returns an avatar for the provided `id`.\n    * `id` can be anything (email, username, md5 hash, as long as it's a valid URI)\n    * defaults to 400px\n* `myserver.com/myAvatars/:size/:id`\n    * returns an avatar for the provided `id` at the specified `size`\n    * size cannot exceed 400px\n* `myserver.com/myAvatars/face/:eyes/:nose/:mouth/:color/:size?`\n    * Allows you to generate a custom avatar from the specified parts and color, and size\n    * e.g. `myserver.com/myAvatars/face/eyes1/nose2/mouth4/DEADBF/300`\n* `myserver.com/myAvatars/list`\n    * returns JSON of all valid parts for the custom endpoint above\n  * `myserver.com/myAvatars/:size?/random`\n      * returns a random avatar, different each time\n      * e.g. `myserver.com/myAvatars/300/random`\n\n\n## Development\nIf you're developing locally, you'll first need to bootstrap (assumes [nvm](https://github.com/creationix/nvm)):\n\n```bash\n# use correct node version\nnvm use\n\n# install dependencies\nnpm install\n```\n\nThen, there are several npm scripts that will be useful:\n\n```bash\n# run the unit tests\nnpm test\n\n# run both a dev server and eslint\nnpm run dev\n\n# run a dev server\nnpm run dev:server\n\n# run eslint\nnpm run dev:lint\n\n# compile the application\nnpm run build\n```\n\n## Contributing\n\nPlease read the [contributors' guide](CONTRIBUTING.md)\n\n## Open-source Contributors\n\n* Kevin Altman [twitter @itg](https://twitter.com/itg) [github @itsthaguy](https://github.com/itsthatguy): Creator of Adorable Avatars, service, site, and artwork.\n* Ryland Herrick [github @rylnd](https://github.com/rylnd): Programmer extraordinaire!\n* [twitter @missingdink](https://twitter.com/missingdink): Illustrated the very first avatars! [Check them out!](http://api.adorable.io/avatar/hi_mom)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsthatguy%2Favatars-api-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsthatguy%2Favatars-api-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsthatguy%2Favatars-api-middleware/lists"}