Migrating from Koa
Shokupan’s context-based approach is inspired by Koa. Migration is straightforward.
Key Differences
Section titled “Key Differences”- Return Value: Shokupan requires returning the response from middleware
- Routing: Built-in routing, no need for external router
- Body Parsing: Built-in, no need for koa-bodyparser
Middleware
Section titled “Middleware”Koa:
app.use(async (ctx, next) => { await next();});Shokupan:
app.use(async (ctx, next) => { const result = await next(); return result; // Must return!});Next Steps
Section titled “Next Steps”- Core Concepts - Learn Shokupan patterns