fastro init
command will generate folders and files like this.
You can access and add additional property to the request object before the controllers process it.
Open middleware file, middleware/support.ts
:
import type { Callback, Request } from "../deps.ts";
export const options = {
methods: ["GET", "POST"],
};
export default (request: Request, next: Callback) => {
request.hello = "with middleware";
next();
};