Skip to main content


Fast and simple web application framework for deno
Go to Latest
interface Fastro
import { type Fastro } from "";


close: () => void

Immediately close the server listeners and associated HTTP connections.

record: Record<string, any>


use(...handler: Array<HandlerArgument>): Fastro

Add application level middleware


import fastro from "../mod.ts";

const f = new fastro();
f.use((req: HttpRequest, _ctx: Context, next: Next) => {
  console.log(`${req.method} ${req.url}`);
  return next();

await f.serve();
get(path: string, ...handler: Array<HandlerArgument>): Fastro
post(path: string, ...handler: Array<HandlerArgument>): Fastro
put(path: string, ...handler: Array<HandlerArgument>): Fastro
delete(path: string, ...handler: Array<HandlerArgument>): Fastro
patch(path: string, ...handler: Array<HandlerArgument>): Fastro
options(path: string, ...handler: Array<HandlerArgument>): Fastro
head(path: string, ...handler: Array<HandlerArgument>): Fastro
hook(hook: Hook): Fastro

Allow you access Server, Request, and Info after Middleware, Routes, Pages, and Static File Processing. It can return Response, Promise<Response> or void.


import fastro, { Fastro, Info } from "../mod.ts";

const f = new fastro();

f.hook((_f: Fastro, _r: Request, _i: Info) => new Response("Hello World"));

await f.serve();
static(path: string, options?: { maxAge?: number; folder?: string; referer?: boolean; }): Fastro

Allow you to access static files with custom path, folder, maxAge, and referer checking.


import fastro from "../mod.ts";

const f = new fastro();

f.static("/static", { folder: "static", maxAge: 90, referer: true });

await f.serve();
path: string,
element: Component,
...handler: Array<MiddlewareArgument>,
): Fastro

Allow you to define SSR page with custom path, element, and handler


import fastro, { Context, HttpRequest } from "../mod.ts";
import user from "../pages/user.tsx";

const f = new fastro();

f.static("/static", { folder: "static", maxAge: 90 });"/", user, (_req: HttpRequest, ctx: Context) => {
    const options = {
      props: { data: "Guest" },
      status: 200,
      html: { head: { title: "React Component" } },
    return ctx.render(options);
await f.serve();
register(mf: ModuleFunction): Promise<Fastro>
getStaticFolder(): string
getStaticPath(): string
getDevelopmentStatus(): boolean
method?: string,
path?: string,
...handler: Array<HandlerArgument>,
): Fastro

Add a handler directly

onListen(handler: ListenHandler): void
finished(): Promise<void> | undefined
getNest(): Nest
serve(): Promise<void>

Serves HTTP requests

If the server was constructed without a specified port, 8000 is used.