Skip to main content



Fastro is web framework for developers who are obsessed with simplicity & performance.

It is inspired by Express, Fastify, Nest & Firebase.

import { Fastro } from "";
const server = new Fastro();
server.get("/", (req) => req.send("root"));
await server.listen();


If performance is really important to you, here are the Hello World benchmark results. Check this folder to see the details.

Framework Version Router? Avg Req
Deno http 1.1.0 17606.41
Node http 14.3.0 16321.2
Fastro 0.11.0 14807.2
Fastify 2.14.1 13435.2
Abc 1.0.0-rc10 11696.8
Oak 4.0.0 11534.6
Express 4.17.1 7637.64
PHP 7.3.11 5932.19
Python Flask 1.1.2 582.5

How to use

This module uses the git release. If you want to pick a specific version, for example 0.11.0, then the full url is If you do not use the version, it will refer to master branch. Breaking changes may be made without warning.


You can add new properties or functions for specific URL to the default request. This is similar to the express middleware.

const middleware = (req: Request, done: Function) => {
  req.oke = () => req.send("oke");

  .get("/", (req) => req.oke());


Another way to add a new property or function globally to the fastro instance and request object is to use a decorator. This is similar to the fastify decorator.

  .decorate((instance) => instance.ok = "ok")
  .decorate((instance) => instance.hello = (payload: string) => payload)
  .decorateRequest((req) => req.oke = "oke request");

  .get("/", (req) => req.send(server.ok))
  .get("/hello", (req) => req.send(server.hello("hello")))
  .get("/oke", (req) => req.send(req.oke));


You can add new properties or functions to the fastro instance. You can also use all default instance functions, include decorator, create routes & middleware. This is similar to the fastify plugin.

const routes = function (fastro: Fastro, done: Function) {
    .get("/", (req) => req.send("root"))
    .post("/", (req) => req.send("post"))
    .put("/", (req) => req.send("put"))
    .delete("/", (req) => req.send("delete"));


Depedency Injection

With depedency injection you can create complex applications with clean code. No longer need to manually import handlers and services. You only make a class and add typescript decorator to define gateway, controller, service and route. Fastro will automatically load, register and create them for you. This is similar to nest.

import { Controller, Get, Request } from "";

class Greet {

  handler(req: Request) {


With functions, you only need to define the main url and the handler. There is no need to define a method, so you can use all types of http methods. You can also get the url parameters more dynamically without defining the full url.

server.function("/prefix/function", (req) => {
  if (!req.url.includes("/prefix/function")) return server.forward(req);

Please note, in this version dependency-injection cannot be used in fastro-function.


Check this folder to find out how to: