fastro init
command will generate folders and files like this.
module/hello.controller.ts
:
import type { Request } from "../deps.ts";
export default (request: Request) => {
// request.view("hello.template.html", { greeting: "Hello", name: "World" });
request.send(`setup ${request.hello}`);
};
Please note that:
request.hello
variable is come from middleware setup.Run server
With fastro-cli
fastro serve
Or with entrypoint
deno run -A main.ts
http://localhost:3000/hello