Skip to content

v0.6.0

Latest
Compare
Choose a tag to compare
@Danilqa Danilqa released this 24 Feb 11:34
· 9 commits to main since this release

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