v0.5.2
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,
];