When to use this skill
Use this skill whenever the user wants to:
- Writing Node.js HTTP services, middleware and the onion model with Koa
- Configure routing (koa-router), body parsing, error handling and deployment
How to use this skill
- Core: Koa(), ctx and next; async middleware and onion order; ctx.body, ctx.status.
- Ecosystem: koa-router, koa-bodyparser, koa-static; error and logging middleware.
- Reference:https://koajs.com/
Best Practices
- Correct use of middleware async and next; unified error catching.
- Use a reverse proxy and HTTPS in production; security and CORS.
Keywords
koa, Node.js, middleware, onion model