You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module is extracted from the AdonisJS framework to work as a standalone HTTP server. The performance of the server is on par with Fastify (not as fast as fastify though).
9
-
10
-
11
-
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
12
-
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
13
-
## Table of contents
14
-
15
-
-[Benchmarks](#benchmarks)
16
-
-[Features](#features)
17
-
-[Usage](#usage)
18
-
19
-
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
20
-
21
-
## Benchmarks
22
-
The benchmarking scheme is taken from the Fastify github repo.
You can run the same benchmarks by cloning the repo and then running the following command.
33
-
34
-
```sh
35
-
npm run benchmark
36
-
```
37
-
38
-
Since the program correctness and reliability is more important over micro optimizations. We pay penality on following fronts in comparison to Fastify.
)`, wherease fastify doesn't parse it by default for performance reasons. However, you can also define your own query string parser with fastify, but again, you will end up paying the same performance penality.
42
-
-**Subdomain based routing** is another front, where AdonisJS has to perform little bit extra work to find the correct route and it's handler.
43
-
44
-
## Features
45
-
46
-
- The most advanced router with support for **route resources**, **route groups**, **subdomains routing**.
47
-
- Support for **global** and **route specific** middleware.
48
-
- Reliable and stable query string parser.
49
-
- Global exception handler to catch all exceptions handled during an HTTP request.
50
-
- Sends data to AdonisJS inbuilt profiler
51
-
52
-
## Usage
53
-
You must be using the server inside a fully fledged AdonisJS application. Still, here's how you can start the standlone server.
<p>A fully feature HTTP server with first class support for <strong>Route groups</strong>, <strong>Sub-domain routing</strong>, <strong>Middleware</strong> and <strong>Cookies</strong>.</p>
You can run the same benchmarks by cloning the repo and then running the following command.
13
+
14
+
```sh
15
+
npm run benchmark
16
+
```
17
+
18
+
Since the program correctness and reliability is more important over micro optimizations. We pay penalty on following fronts in comparison to Fastify.
19
+
20
+
-**The AdonisJS query string parser can parse arrays inside the query string** `(/api?foo[]=bar&foo[]=fuzz&foo[]=buzz
21
+
)`, wherease fastify doesn't parse it by default for performance reasons. However, you can also define your own query string parser with fastify, but again, you will end up paying the same performance penalty.
22
+
-**Subdomain based routing** is another front, where AdonisJS has to perform little bit extra work to find the correct route and it's handler by matching the domains first.
23
+
-**Middleware support** is inbuilt in AdonisJS. Whereas, with [fastify you will have to install](https://www.fastify.io/docs/latest/Middleware/) additional packages for middleware support.
0 commit comments