Skip to main content
Module

x/fastro/examples/decorate.ts

Fast and simple web application framework for deno
Go to Latest
File
import { Fastro } from "../mod.ts";const server = new Fastro();server .decorate((instance) => instance.ok = "ok") .decorate((instance) => instance.hello = (payload: string) => payload) .decorateRequest((req) => req.oke = "oke request");
server .get("/", (req) => req.send(server.ok)) .get("/hello", (req) => req.send(server.hello("hello"))) .get("/oke", (req) => req.send(req.oke));
await server.listen({ port: 8000 });