{"id":41180979,"url":"https://github.com/twoojoo/waffle","last_synced_at":"2026-01-22T20:05:50.803Z","repository":{"id":65427308,"uuid":"592148336","full_name":"twoojoo/waffle","owner":"twoojoo","description":"A Fastify wrapper that makes HTTP servers stupidly easy","archived":false,"fork":false,"pushed_at":"2023-05-08T06:35:37.000Z","size":250,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T22:50:38.377Z","etag":null,"topics":["api","fastify","fluent-interface","hooks","http","rate-limiter","rest","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twoojoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-23T03:14:26.000Z","updated_at":"2023-05-08T07:00:11.000Z","dependencies_parsed_at":"2023-02-16T10:50:28.357Z","dependency_job_id":null,"html_url":"https://github.com/twoojoo/waffle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/twoojoo/waffle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twoojoo%2Fwaffle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twoojoo%2Fwaffle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twoojoo%2Fwaffle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twoojoo%2Fwaffle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twoojoo","download_url":"https://codeload.github.com/twoojoo/waffle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twoojoo%2Fwaffle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28670366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T19:36:09.361Z","status":"ssl_error","status_checked_at":"2026-01-22T19:36:05.567Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","fastify","fluent-interface","hooks","http","rate-limiter","rest","typescript"],"created_at":"2026-01-22T20:05:50.723Z","updated_at":"2026-01-22T20:05:50.799Z","avatar_url":"https://github.com/twoojoo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Waffle - A fluent Fastify wrapper that makes HTTP servers stupidly easy\n\n## Install\n\n```bash\nnpm i @twoojoo/waffle\n```\n\n## Description\n\nWaffle allows you to easily build an HTTP server using [Fastyfy](https://github.com/fastify/fastify) with a completely **fluent syntax**. \nIt supports route types and schemas and all main Fastify features, while fully allowing to interact with the underlying Fastify instance.\n\nIt also comes **shipped with some useful plugins** such as [rate limter](https://github.com/fastify/fastify-rate-limit), [cors](https://github.com/fastify/fastify-cors) and [json schema parser](https://www.npmjs.com/package/json-schema-to-ts), to further decrease development time.\n\nIt's **typescript first**. If you provide json schemas (see [this example](./examples/validation.ts)), route types will be automatically inferred, achieving validation and type safety all at once!\n\n## Sample\n\n```typescript\nimport { Waffle } from \"@twoojoo/waffle\"\n\nconst server = Waffle({ logger: true })\n\t//all Fastify hooks available (at server, version, prefix or route level)\n\t.onRequest(async (req, rep) =\u003e console.log(\"1) on request hook\"))\n\t.preParsing(async (req, rep) =\u003e console.log(\"2) pre parsing hook\"))\n\t.preValidation(async (req, rep) =\u003e console.log(\"3) pre validation hook\"))\n\t.preHandler(async (req, rep) =\u003e console.log(\"4) pre handler hook\"))\n\t.preSerialization(async (req, rep) =\u003e console.log(\"5) pre serialization hook\"))\n\t.onSend(async (req, rep) =\u003e console.log(\"6) on send hook\"))\n\t.onError(async (req, rep) =\u003e console.log(\"6) on error hook\"))\n\t.onResponse(async (req, rep) =\u003e console.log(\"6) on response hook\"))\n\t.limiter({max: 1, timeWindow: 60*1000}) \n\t.cors({/*..cors options..*/})\n\nserver.version(1) //API version management\n\t.prefix(\"users\") //API resource management through route prefix\n\t.GET(\":id\").handler(async (req, rep) =\u003e  /*...route logic..*/) // GET http://localhost:3001/v1/users/:id\n\t.DELETE(\":id\").handler(async (req, rep) =\u003e   /*...route logic..*/) // DELETE http://localhost:3001/v1/users/:id\n\nserver.version(2)\n\t.prefix(\"customers\") //prefix specific hooks and limiters\n\t.limiter({max: 1, timeWindow: 60*1000})\n\t.onRequest(async (req, rep) =\u003e console.log(\"on request customers hook\")) \n\n\t.GET(\":id\")  // GET http://localhost:3001/v1/customers/:id\n\t.handler(async (req, rep) =\u003e  /*...route logic..*/)\n\n\t.POST()  // POST http://localhost:3001/v1/customers\n\t.bodySchema(bodySchema) //route json schema both for validation and type safety\n\t.handler(async (req, rep) =\u003e  console.log(req.body.name)) // \u003c-- autocomplete\n\nserver.address(\"localhost\", 3001)\n\t.listen()\n```\n\n## Examples\n\nSee [examples folder](./examples)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwoojoo%2Fwaffle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwoojoo%2Fwaffle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwoojoo%2Fwaffle/lists"}