Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fastro/mod.ts>Fastro

Full Stack Framework for Deno, TypeScript, Preact JS and Tailwind CSS
Go to Latest
interface Fastro
import { type Fastro } from "https://deno.land/x/fastro@v0.84.23/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>,
...middleware: Array<Handler>,
): Fastro
add(
method: string,
path: string,
handler: Handler,
): Fastro
use(...handler: Array<Handler>): Fastro
group(mf: ModuleFunction): Promise<Fastro>
getNonce(): string