What's new
Features
Added the ability to modify or override a final result in middlewares (#41).
For example, you can now set response headers in Bun inside middlewares:
import type { NextFunction } from 'node-file-router';
export async function useCors(req: Request, next: NextFunction<Response>) {
const res = await next();
res.headers.set('Access-Control-Allow-Methods', 'PUT, POST, OPTIONS, HEAD');
return res;
}
Documentation
- Added information about this update.
- Set the valid links for Edit this page