Skip to main content
Module

x/fastro/app/m.ts

The Web Framework for Full Stack Apps
Go to Latest
File
import fastro, { Context, HttpRequest } from "../http/server.ts";import uuid from "../pages/uuid.tsx";import layout from "./l.ts";
const f = new fastro();f.get("/api", () => Response.json({ uuid: crypto.randomUUID() }));f.static("/static", { folder: "static", maxAge: 90 });f.page( "/", uuid, (_req: HttpRequest, ctx: Context) => { const options = layout({ title: "React component", description: "This is simple react component", }); return ctx.render(options); },);
await f.serve();