{"id":14989639,"url":"https://github.com/danielwpz/crepecake","last_synced_at":"2026-01-04T10:48:06.987Z","repository":{"id":54187891,"uuid":"166097623","full_name":"danielwpz/crepecake","owner":"danielwpz","description":"REST API server framework based on koa","archived":false,"fork":false,"pushed_at":"2021-03-18T07:54:58.000Z","size":485,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-27T02:17:10.518Z","etag":null,"topics":["koajs","nodejs","rest-api"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielwpz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-16T19:26:30.000Z","updated_at":"2021-07-21T18:06:14.000Z","dependencies_parsed_at":"2022-08-13T08:40:52.578Z","dependency_job_id":null,"html_url":"https://github.com/danielwpz/crepecake","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fcrepecake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fcrepecake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fcrepecake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fcrepecake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielwpz","download_url":"https://codeload.github.com/danielwpz/crepecake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244875047,"owners_count":20524591,"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":["koajs","nodejs","rest-api"],"created_at":"2024-09-24T14:18:41.359Z","updated_at":"2026-01-04T10:48:06.960Z","avatar_url":"https://github.com/danielwpz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CrepeCake\n\nREST API server framework based on koa.\n\n## Install\n`npm install crepecake`\n\n## Getting started\n\nexample:\n```javascript\nconst CrepeCake = require('../index');\nconst HttpResponse = CrepeCake.HttpResponse;\n\nconst app = new CrepeCake();\nconst router = new CrepeCake.Router();\n\n// -- Build your router\n\nrouter.get('/', (ctx) =\u003e {\n  return 'ok';\n});\n\nrouter.post('/login', (ctx) =\u003e {\n  throw HttpResponse.notImplemented();\n});\n\n// -- Register middlewares\n\napp.use(async function requestLogger(ctx, next) {\n  console.log(`${ctx.request.method} ${ctx.request.url}`);\n  await next();\n});\n\napp.use(router);\n\n// -- Run\n\napp.listen(3000, () =\u003e {\n  console.log('CrepeCake server running...');\n});\n```\n\n## Difference with Koa\n1. Routing     \n   You don't need to import `koa-router` separately, crepecake itself exposes a `Router` class, which has the same interface as koa router.      \n   And you can directly mount a router onto another one, without doing `routeA.use(routeB.routes())`.     \n\n2. Response parsing      \n   In Koa, you need to do `ctx.body = 'hello, world'` in order to send a response. With crepecake, you can just return an object or an instance of `HttpResponse` from an async middleware function, crepecake will handle the response parsing properly and reply to the client.    \n\n3. Error handling      \n   Some shortcuts for throwing server errors are provided such like `HttpResponse.internalError` for your convenience. But you can still throw an error at anytime, the normal error handling procedure of Koa will be used in that case.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielwpz%2Fcrepecake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielwpz%2Fcrepecake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielwpz%2Fcrepecake/lists"}