Skip to main content
Module

x/fastro/mod.ts>Fastro

Full Stack Framework for Deno, TypeScript, Preact JS and Tailwind CSS
Latest
interface Fastro
import { type Fastro } from "https://deno.land/x/fastro@v0.88.3/mod.ts";

Defines the application endpoint, middleware, group, and serve

Example:

import fastro from "https://fastro.deno.dev/mod.ts";

const f = new fastro();

f.get("/", () => "Hello, World!");

await f.serve();

Properties

serve: (options?: { port?: number; onListen?: ListenHandler; }) => Promise<void>
shutdown: () => void
serverOptions: Record<string, any>

Methods

get(path: string, ...handler: Array<Handler>): Fastro
post(path: string, ...handler: Array<Handler>): Fastro
put(path: string, ...handler: Array<Handler>): Fastro
patch(path: string, ...handler: Array<Handler>): Fastro
delete(path: string, ...handler: Array<Handler>): Fastro
options(path: string, ...handler: Array<Handler>): Fastro
head(path: string, ...handler: Array<Handler>): Fastro
page<T = any>(path: string, page: Page<T>): Fastro
add(
method: string,
path: string,
handler: Handler,
): Fastro
use(...handler: Array<Handler>): Fastro
group(mf: ModuleFunction): Promise<Fastro>
getNonce(): string
getPages(): Record<string, Page>
getRoutes(): Record<string, Handler>