Skip to content

v0.5.2

Choose a tag to compare

@Danilqa Danilqa released this 30 Jan 08:39
· 28 commits to main since this release

What's new

Important Fixes

Added a proper route params processing in the middlewares (#35).

For instance, the following code will now work correctly:

// file: api/users/[id].[post].js
async function useMyMiddleware(req: Request, next: NextFunction, routeParams: Record<string, string>) {
  // routeParams now have values here
  await next();
}

async function createOrUpdateUser(req: Request, routeParams: RouteParams) {
  // As well as here
}

export default [
  useMyMiddleware,
  createOrUpdateUser,
];

Documentation

Added information about this update.