fastro

deno fast web framework

https://github.com/fastrojs/fastro-server

.github

.vscode

benchmarks

cli

core

services

_config.yml

deps.ts

mod.ts

readme.md

FASTRO

Fast & simple web framework with dynamic routes. Built on top of deno standart modules.

Boilerplate Architecture

  • Structure
    Webapp
    โ”œโ”€โ”€ main.ts
    โ””โ”€โ”€ services
        โ””โ”€โ”€ hello.ts
  • Modules

    FileUsage for
    main.tsWebapp entrypoint
    services/hello.tsEndpoint handler. You can access it via URL: http://localhost:3000/hello

How to use

  • Create entrypoint
    import { Fastro } from "https://raw.githubusercontent.com/fastrodev/fastro/master/mod.ts";
    const server = new Fastro();
    server.listen();
  • Create services folder
    mkdir services
  • Create hello.ts file

    import type { ServerRequest } from "https://deno.land/std@0.71.0/http/server.ts";
    
    export const handler = async (request: ServerRequest) => {
        request.respond({ status: 200, body: "hello" });
    };
  • Run server

    deno run -A main.ts
  • Open url
    http://localhost:3000/hello

Command Line Interface

You can also run your project using fastro cli.

  • Development

    deno run --watch --unstable -A https://raw.githubusercontent.com/fastrodev/fastro/master/cli/fastro.ts serve
  • Production

    deno install -A https://raw.githubusercontent.com/fastrodev/fastro/master/cli/fastro.ts
    fastro serve --port 8080