Repository
Current version released
4 years ago
Dependencies
std
Versions
- v0.92.2Latest
- 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
Web framework for developers obsessed with performance and simplicity
Fastro is inspired by Fastify & Express.
import { Fastro } from "https://deno.land/x/fastro/mod.ts";
const server = new Fastro();
server.get("/", (req) => req.send("root"));
await server.listen();
Benchmarks
If performance is important to you, here are the benchmark results:
Framework | Version | Router? | Avg Req |
---|---|---|---|
Abc | 1.0.0-rc8 | ✓ | 962.3 |
Deno http |
1.0.3 | ✗ | 2197 |
Express | 4.17.1 | ✓ | 470.4 |
Fastify | 2.14.1 | ✓ | 1122.2 |
Fastro | 0.6.0 | ✓ | 1432.4 |
Node http |
14.3.0 | ✗ | 2464.6 |
Oak | 4.0.0 | ✓ | 1000.9 |
Check this folder to see the detail method.
Middleware
You can add new properties or functions to the default request
. This is similar to the express middleware.
const middleware = (req: Request) => {
req.hi = (word: string) => {
req.send(word);
};
};
server.use(middleware);
Plugin
You can add new properties or functions to the fastro instance. You can also use all default instance functions, include create routes & middleware. This is similar to the fastify plugin.
const routes = function (fastro: Fastro) {
fastro
.get("/", (req) => {
req.send("root");
})
.post("/", (req) => {
req.send("post");
})
.put("/", (req) => {
req.send("put");
})
.delete("/", (req) => {
req.send("delete");
});
};
server.register(routes);
How to use
This module uses the git release. If you want to pick a specific version, for example v0.6.0
, then the full url is https://deno.land/x/fastro@v0.6.0/mod.ts
. If you do not use the version, it will refer to master
branch.
Examples
Check this folder to find out how to:
- change default port & add optional listen callback
- send simple text & json data
- get url parameters
- get payload from post method
- set custom http headers & status
- change the request object by creating a middleware
- create simple jwt auth
- create global & url middleware
- create decorator to add new property
- create router with plugin
- create simple REST API
- create simple REST API with JWT