- v0.94.1Latest
- v0.94.0
- v0.93.10
- v0.93.9
- v0.93.8
- v0.93.7
- v0.93.6
- v0.93.5
- v0.93.4
- v0.93.3
- v0.93.2
- v0.93.1
- v0.93.0
- v0.92.2
- v0.92.1
- v0.92.0
- v0.91.1
- v0.91.0
- v0.90.0
- v0.89.4
- v0.89.3
- v0.89.2
- v0.89.1
- v0.89.0
- v0.88.3
- v0.88.2
- v0.88.1
- v0.88.0
- v0.87.3
- v0.87.2
- v0.87.1
- v0.87.0
- v0.86.1
- v0.86.0
- v0.85.1
- v0.85.0
- v0.84.30
- v0.84.29
- v0.84.28
- v0.84.27
- v0.84.26
- v0.84.25
- v0.84.24
- v0.84.23
- v0.84.22
- v0.84.21
- v0.84.20
- v0.84.19
- v0.84.18
- v0.84.17
- v0.84.16
- v0.84.15
- v0.84.14
- v0.84.13
- v0.84.12
- v0.84.11
- v0.84.10
- v0.84.9
- v0.84.8
- v0.84.7
- v0.84.6
- v0.84.5
- v0.84.4
- v0.84.3
- v0.84.2
- v0.84.1
- v0.84.0
- v0.83.5
- v0.83.4
- v0.83.3
- v0.83.2
- v0.83.1
- v0.83.0
- v0.82.3
- v0.82.2
- v0.82.1
- v0.82.0
- v0.81.5
- v0.81.4
- v0.81.3
- v0.81.2
- v0.81.1
- v0.81.0
- v0.80.5
- v0.80.4
- v0.80.3
- v0.80.2
- v0.80.1
- v0.80.0
- v0.79.3
- v0.79.2
- v0.79.1
- v0.79.0
- v0.78.2
- v0.78.1
- v0.78.0
- v0.77.11
- v0.77.10
- v0.77.9
- v0.77.7
- v0.77.8
- v0.77.6
- v0.77.5
- v0.77.4
- v0.77.3
- v0.77.2
- v0.77.1
- v0.77.0
- v0.76.3
- v0.76.2
- v0.76.1
- v0.76.0
- v0.75.13
- v0.75.12
- v0.75.11
- v0.75.10
- v0.75.9
- v0.75.8
- v0.75.7
- v0.75.6
- v0.75.5
- v0.75.4
- v0.75.3
- v0.75.2
- v0.75.1
- v0.75.0
- v0.74.9
- v0.74.8
- v0.74.7
- v0.74.6
- v0.74.5
- v0.74.4
- v0.74.3
- v0.74.2
- v0.74.1
- v0.74.0
- v0.73.0
- v0.72.2
- v0.72.1
- v0.72.0
- v0.71.2
- v0.71.1
- v0.71.0
- v0.70.5
- v0.70.4
- v0.70.3
- v0.70.2
- v0.70.1
- v0.70.0
- v0.69.4
- v0.69.3
- v0.69.2
- v0.69.1
- v0.69.0
- v0.68.2
- v0.68.1
- v0.68.0
- v0.67.2
- v0.67.1
- v0.67.0
- v0.66.0
- v0.65.5
- v0.65.4
- v0.65.3
- v0.65.2
- v0.65.1
- v0.65.0
- v0.64.4
- v0.64.4
- v0.64.3
- v0.64.2
- v0.64.1
- v0.64.0
- v0.63.9
- v0.63.8
- v0.63.7
- v0.63.6
- v0.63.5
- v0.63.4
- v0.63.4
- v0.63.3
- v0.63.2
- v0.63.1
- v0.63.1
- v0.63.0
- v0.62.16
- v0.62.15
- v0.62.14
- v0.62.13
- v0.62.12
- v0.62.11
- v0.62.10
- v0.62.9
- v0.62.8
- v0.62.7
- v0.62.6
- v0.62.5
- v0.62.4
- v0.62.3
- v0.62.2
- v0.62.1
- v0.62.0
- v0.61.3
- v0.61.2
- v0.61.1
- v0.61.0
- v0.60.1
- v0.60.0
- v0.59.2
- v0.59.1
- v0.59.0
- v0.58.4
- v0.58.3
- v0.58.2
- v0.58.1
- v0.58.0
- v0.57.6
- v0.57.5
- v0.57.4
- v0.57.3
- v0.57.2
- v0.57.1
- v0.57.0
- v0.56.2
- v0.56.1
- v0.56.0
- v0.55.0
- v0.54.0
- v0.53.2
- v0.53.1
- v0.53.0
- v0.52.0
- v0.51.2
- v0.51.1
- v0.51.0
- v0.50.0
- v0.49.0
- v0.48.1
- v0.48.0
- v0.47.0
- v0.46.0
- v0.45.0
- v0.44.0
- v0.43.0
- v0.42.1
- v0.42.0
- v0.41.3
- v0.41.2
- v0.41.1
- v0.41.0
- v0.40.1
- v0.40.0
- v0.39.0
- v0.38.0
- v0.37.1
- v0.37.0
- v0.36.0
- v0.35.0
- v0.34.0
- v0.33.1
- v0.33.0
- v0.32.0
- v0.31.2
- v0.31.1
- v0.31.0
- v0.30.60
- v0.30.59
- v0.30.58
- v0.30.57
- v0.30.56
- v0.30.55
- v0.30.54
- v0.30.53
- v0.30.52
- v0.30.51
- v0.30.50
- v0.30.49
- v0.30.48
- v0.30.47
- v0.30.46
- v0.30.45
- v0.30.44
- v0.30.43
- v0.30.42
- v0.30.41
- v0.30.40
- v0.30.39
- v0.30.38
- v0.30.37
- v0.30.36
- v0.30.35
- v0.30.34
- v0.30.33
- v0.30.32
- v0.30.31
- v0.30.30
- v0.30.29
- v0.30.28
- v0.30.27
- v0.30.26
- v0.30.25
- v0.30.24
- v0.30.23
- v0.30.22
- v0.30.21
- v0.30.20
- v0.30.19
- v0.30.18
- v0.30.17
- v0.30.16
- v0.30.15
- v0.30.14
- v0.30.13
- v0.30.12
- v0.30.11
- v0.30.10
- v0.30.9
- v0.30.8
- v0.19.1
- v0.19.0
- v0.18.0
- v0.17.0
- v0.16.0
- v0.15.2
- v0.15.1
- v0.15.0
- v0.14.5
- v0.14.4
- v0.14.3
- v0.14.2
- v0.14.1
- v0.14.0
- v0.13.15
- v0.13.14
- v0.13.13
- v0.13.12
- v0.13.11
- v0.13.10
- v0.13.9
- v0.13.8
- v0.13.7
- v0.13.6
- v0.13.5
- v0.13.4
- v0.13.3
- v0.13.2
- v0.13.1
- v0.13.0
- v0.12.4
- v0.12.3
- v0.12.2
- v0.12.1
- v0.12.0
- v0.11.4
- v0.11.3
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.0
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.1
- v0.7.0
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.5
- v0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.13
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.0
Fastro is web framework for developers who are obsessed with simplicity & performance. It is inspired by Express & Fastify.
Check these benchmarks to compare its speed with others.
After refactoring, these features will be released in the next version:
- Dependency injection
- Command line interface (CLI)
- Cloud function
Table of contents
Benchmarks
Go to this folder to check detailed methods & results.
Framework | Version | Requests/s | Percentage | Router? |
---|---|---|---|---|
Deno http | 1.1.3 | 15522.4 | 100.0% | β |
Node http | 14.3.0 | 15218.6 | 98.0% | β |
Fastro | 0.13.0 | 14356.8 | 92.5% | β |
Fastify | 2.15.1 | 12346.7 | 79.5% | β |
Oak | 5.2.0 | 10504.6 | 67.7% | β |
Abc | 1.0.0 | 10137.5 | 65.3% | β |
Express | 4.17.1 | 6852.1 | 44.1% | β |
PHP | 7.3.11 | 5979.4 | 38.5% | β |
Python Flask | 1.1.2 | 544.2 | 3.5% | β |
How to use
This module uses the git release. If you do not use the version, simply change v0.13.0
to master
branch. Breaking changes may be made without warning.
import { Fastro } from "https://raw.githubusercontent.com/fastrodev/fastro/v0.13.0/mod.ts";
const server = new Fastro();
server.get("/", (req) => req.send("root"));
await server.listen();
Run this command to try directly:
deno run --allow-net https://raw.githubusercontent.com/fastrodev/fastro/v0.13.0/examples/hello.ts
Server Options
Server options are used to enable the use of payload
, logger
, and static files
.
Static Files
You can enable the use of static files
by defining the server option to {static: true}
.
const server = new Fastro({ static: true });
server.static("/", "public")
Payload
You can enable the use of payload
by defining the server option to {payload: true}
.
const server = new Fastro({ payload: true });
server.post("/hello", (req) => {
const payload = req.payload;
req.send(payload);
});
Logger
You can enable the use of logger
by defining the server option to {logger: true}
.
const server = new Fastro({ logger: true });
You can also enable all server options at once:
const server = new Fastro({ payload: true, static: true, logger: true });
Middleware
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.root = () => req.send("root");
done();
};
server
.use(middleware)
.get("/", (req) => req.root());
Plugin
You can add new properties or functions to the fastro instance. You can also use all default instance functions, create routes & middleware. This is similar to the fastify plugin.
const routes = function (fastro: Fastro, done: Function) {
fastro
.get("/", (req) => req.send("root"))
.post("/", (req) => req.send("post"))
.put("/", (req) => req.send("put"))
.delete("/", (req) => req.send("delete"));
done();
};
server.register(routes);
Examples
Run this command to try directly.
deno run -A https://raw.githubusercontent.com/fastrodev/fastro/v0.13.0/examples/hello.ts
You can replace above url with these raw urls.
Title | Raw URL |
---|---|
Create hello world app | https://raw.githubusercontent.com/fastrodev/fastro/v0.13.0/examples/hello.ts |
Use the basics | https://raw.githubusercontent.com/fastrodev/fastro/v0.13.0/examples/basic.ts |
Get url parameter | https://raw.githubusercontent.com/fastrodev/fastro/v0.13.0/examples/basic.ts |
Get a payload | https://raw.githubusercontent.com/fastrodev/fastro/v0.13.0/examples/basic.ts |
Send results as a file | https://raw.githubusercontent.com/fastrodev/fastro/v0.13.0/examples/basic.ts |
Serve static files | https://raw.githubusercontent.com/fastrodev/fastro/v0.13.0/examples/static.ts |
Create a middleware | https://raw.githubusercontent.com/fastrodev/fastro/v0.13.0/examples/middleware.ts |
Create a plugin | https://raw.githubusercontent.com/fastrodev/fastro/v0.13.0/examples/plugin.ts |