Skip to content

Migrating from Koa

Shokupan’s context-based approach is inspired by Koa. Migration is straightforward.

  1. Return Value: Shokupan requires returning the response from middleware
  2. Routing: Built-in routing, no need for external router
  3. Body Parsing: Built-in, no need for koa-bodyparser

Koa:

app.use(async (ctx, next) => {
await next();
});

Shokupan:

app.use(async (ctx, next) => {
const result = await next();
return result; // Must return!
});