Docs
Migration

Migration

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

#From 3.x to 4.x

Migration from 3.x.

#From 2.x to 3.x

Migration from 2.x.

#From 1.x to 2.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[];