Skip to main content
Module

x/fastro/examples/route_params.ts

Fast and simple web application framework for deno
Go to Latest
File
import application, { getParam, getParams } from "../server/mod.ts";
const app = application();
app.get("/:id/user/:name", (req: Request) => { const params = getParams(req); return new Response(JSON.stringify({ params }));});
app.get("/post/:id", (req: Request) => { const param = getParam("id", req); return new Response(param);});
await app.serve();