docs
migration

Migration

This chapter introduces how to go from an old version to a new version.

#From 2.x

Migration from 2.x.

#From 1.x

export default handler no longer provide req and res as parameters. Use ctx instead.

after
import type { PageHandler } from 'zely';
 
export default [
  GET((ctx) => {
    ctx.send('Hello World!');
  }),
] satisfies PageHandler[];
before
import type { PageHandler } from 'zely';
 
export default [
  GET((req, res) => {
    res.send('Hello World!');
  }),
] satisfies PageHandler[];