diesel-core 0.0.21 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONTRIBUTING.md CHANGED
@@ -1,3 +1,3 @@
1
- only i know folder structure and codebase , if u dont understand it dont worry , just ping me.
2
-
1
+ only i know folder structure and codebase , if u dont understand it dont worry , just ping me.
2
+
3
3
  if you changes code OR fixing bugs so after doing make sure to run tsc and bun build.js
package/LICENSE CHANGED
@@ -1,8 +1,8 @@
1
- Diesel.js License
2
- Copyright (c) 2024 Pradeep Sahu
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
-
6
- 1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
-
8
- 2. The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Software or the use or other dealings in the Software.
1
+ Diesel.js License
2
+ Copyright (c) 2024 Pradeep Sahu
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ 1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ 2. The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Software or the use or other dealings in the Software.
package/README.md CHANGED
@@ -1,275 +1,276 @@
1
- # DieselJS
2
-
3
- **made only for bun***
4
-
5
- **Diesel** is a simple and lightweight HTTP server library for Bun.js that provides you with complete control over your API routes and middleware. It is designed to be intuitive and efficient, allowing you to quickly set up a server, define routes, and optimize important paths for faster response times.
6
-
7
- With built-in support for TypeScript, DieselJS ensures type safety and improved developer experience, making it easier to catch errors during development. Whether you are building a small application or a large API, DieselJS helps you manage your routes and middleware seamlessly.
8
-
9
-
10
- ## Installation
11
- Install diesel-core via bun | npm | yarn | pnpm
12
-
13
- ```bash
14
- npm install diesel-core
15
- ```
16
- ```bash
17
- bun add diesel-core
18
- ```
19
-
20
- ### Code Example
21
- ```javascript
22
- import {Diesel} from "diesel-core"
23
-
24
- const app = new Diesel()
25
- const port = 3000
26
-
27
- app.get("/", async (ctx:ContextType) => {
28
- return ctx.status(200).text("Hello world...!")
29
- })
30
-
31
- // Start the server
32
- app.listen(port, () => {
33
- console.log(`diesel is running on port ${port}`)
34
- })
35
- ```
36
-
37
- # CORS
38
-
39
- ### Diesel supports cors out of the box
40
-
41
- ``` javascript
42
- app.cors({
43
- origin: ['http://localhost:5173','*'],
44
- methods: 'GET,POST,PUT,DELETE',
45
- allowedHeaders: 'Content-Type,Authorization'
46
- })
47
- ```
48
-
49
- # Filter and Route Security
50
- **Diesel** provides a simple way to manage public and protected routes by using a filter() method. You can define specific routes to be publicly accessible, while others will require authentication or custom middleware functions.
51
-
52
- ### How to Use the Filter
53
- The **filter()** method allows you to secure certain endpoints while keeping others public. You can specify routes that should be publicly accessible using permitAll(), and apply authentication or other middleware to the remaining routes with require().
54
-
55
-
56
- ### Example Usage
57
- ```javascript
58
- import {Diesel} from "diesel-core";
59
- import jwt from 'jsonwebtoken';
60
-
61
-
62
- const app = new Diesel();
63
-
64
- async function authJwt (xl:ContextType, server?:Server): Promise<void | Response> {
65
- const token = await xl.getCookie("accessToken"); // Retrieve the JWT token from cookies
66
- if (!token) {
67
- return xl.status(401).json({ message: "Authentication token missing" });
68
- }
69
- try {
70
- // Verify the JWT token using a secret key
71
- const user = jwt.verify(token, secret); // Replace with your JWT secret
72
- // Set the user data in context
73
- xl.setUser(user);
74
-
75
- // Proceed to the next middleware/route handler
76
- return xl.next();
77
- } catch (error) {
78
- return xl.status(403).json({ message: "Invalid token" });
79
- }
80
- }
81
-
82
- // Define routes and apply filter
83
- app
84
- .filter()
85
- .routeMatcher('/api/user/register', '/api/user/login', '/test/:id', '/cookie') // Define public routes
86
- .permitAll() // Mark these routes as public (no auth required)
87
- .require(authJwt); // Apply the authJwt middleware to all other routes
88
-
89
- // Example public route (no auth required)
90
- app.get("/api/user/register", async (xl) => {
91
- return xl.json({ msg: "This is a public route. No authentication needed." });
92
- });
93
-
94
- // Example protected route (requires auth)
95
- app.get("/api/user/profile", async (xl) => {
96
- // This route is protected, so the auth middleware will run before this handler
97
- const user = xl.getUser()
98
- return xl.json({
99
- msg: "You are authenticated!" ,
100
- user
101
- });
102
- });
103
-
104
- // Start the server
105
- const port = 3000;
106
- app.listen(port, () => {
107
- console.log(`Diesel is running on port ${port}`);
108
- })
109
-
110
- ```
111
- # Filter Methods
112
- 1. **routeMatcher(...routes: string[])** : Passed endpoints in this routeMatcher will be ***Public*** means they don't need authentication, including those with dynamic parameters (e.g., /test/:id).
113
-
114
- ```javascript
115
- .routeMatcher('/api/user/register', '/api/user/login', '/test/:id')
116
- ```
117
- 1. **permitAll()** : Marks the routes specified in routeMatcher() as publicly accessible, meaning no middleware (like authentication) will be required for these routes.
118
-
119
- ```javascript
120
- .permitAll()
121
- ```
122
- 1. **require(fnc?: middlewareFunc)** :Means that defined routes in ***routeMatcher*** is public & All endpoints needs authentication.
123
-
124
- *Note* : If you don't pass a middleware function to require(), DieselJS will throw an "Unauthorized" error by default. Ensure that you implement and pass a valid authentication function
125
- ```javascript
126
- .require(authJwt)
127
- ```
128
- ## Use Case
129
- * **Public Routes** : Some routes ***(like /api/user/register or /api/user/login)*** are often open to all users without authentication. These routes can be specified with permitAll().
130
-
131
- * **Protected Routes** : For other routes ***(like /api/user/profile)***, you'll want to require authentication or custom middleware. Use require(authJwt) to ensure that the user is authenticated before accessing these routes.
132
-
133
- # Using Hooks in DieselJS
134
-
135
- DieselJS allows you to enhance your request handling by utilizing hooks at various stages of the request lifecycle. This gives you the flexibility to execute custom logic for logging, authentication, data manipulation, and more.
136
-
137
-
138
- ### Available Hooks
139
-
140
- 1. **onRequest**: Triggered when a request is received.
141
- 2. **preHandler**: Invoked just before the request handler executes.
142
- 3. **postHandler**: Executed after the request handler completes but before sending the response.
143
- 4. **onSend**: Called just before the response is sent to the client.
144
- 5. **onError** : Executes if any error occurs
145
-
146
- ### How to Define Hooks
147
-
148
- To define hooks in your DieselJS application, you can add them directly to your `Diesel` instance. Here's how to set up and use each hook:
149
-
150
- ### Example Usage
151
-
152
- ```javascript
153
-
154
- // define and onError hook
155
-
156
- app.addHooks("onError",(error,req,url,server) => {
157
- console.log(`error occured ${error.message}`)
158
- // retunr new Response(......)
159
- })
160
-
161
- // Define an onRequest hook
162
- app.addHooks("onRequest",(req,url,server) =>{
163
- console.log(`Request received: ${req.method} ${url}`);
164
- })
165
- // you get req,url & server instance in onReq
166
-
167
- // Define a preHandler hook
168
- app.addHooks("preHandler",(xl) =>{
169
- // Check for authentication token
170
- const authToken = xl.req.headers.get("Authorization");
171
- if (!authToken) {
172
- return new Response("Unauthorized", { status: 401 });
173
- }
174
- })
175
-
176
- // Define a postHandler hook
177
- app.addHooks('postHandler', async (xl) => {
178
- console.log(`Response sent for: ${xl.req.url}`);
179
- });
180
-
181
- // Define an onSend hook
182
- app.addHooks('onSend',async (xl, result) => {
183
- console.log(`Sending response with status: ${result.status}`);
184
- return result; // You can modify the response here if needed
185
- });
186
- ```
187
-
188
- # Middleware example
189
-
190
- **No Need to call NonSense *next()* in Middleware**
191
-
192
- **just dont return , if evrything goes right**
193
-
194
- ```javascript
195
- async function authJwt (ctx:ContextType, server?:Server): Promise<void | Response> {
196
-
197
- try {
198
- const token = ctx?.getCookie("accessToken");
199
- if (!token) {
200
- return ctx.status(401).json({ message: "Authentication token missing" });
201
- }
202
- // Verify the JWT token using a secret key
203
- const user = jwt.verify(token, secret);
204
- ctx.set('user',user);
205
- } catch (error) {
206
- return ctx.status(403).json({ message: "Invalid token" });
207
- }
208
- }
209
-
210
- // this is a global middleware
211
- app.use(authJwt)
212
-
213
- // path middleware example
214
- app.use("/user",authJWT)
215
-
216
- ```
217
-
218
- # set cookies
219
-
220
- ```javascript
221
- app.get("/set-cookie", async(xl) => {
222
- const user = {
223
- name: "pk",
224
- age: 22,
225
- }
226
-
227
- const accessToken = jwt.sign(user, secret, { expiresIn: "1d" })
228
-
229
- const refreshToken = jwt.sign(user, secret ,{ expiresIn: "10d" })
230
-
231
- const options = {
232
- httpOnly: true,
233
- secure: true,
234
- maxAge: 24 * 60 * 60 * 1000,
235
- sameSite: "Strict",
236
- path: "/",
237
- }
238
-
239
- xl
240
- .setCookie("accessToken", accessToken, options)
241
- .setCookie("refreshToken", refreshToken, options)
242
-
243
- return xl.json({msg:"setting cookies"})
244
- })
245
- ```
246
-
247
- # Render a HTML page
248
- ```javascript
249
- app.get("/render",async (xl) => {
250
- return xl.html(`${import.meta.dir}/index.html`)
251
- })
252
- ```
253
- # redirect
254
- ```javascript
255
- app.get("/redirect",(xl) => {
256
- return xl.redirect("/");
257
- })
258
- ```
259
- # get params
260
-
261
- **You can use set ***Multiparams***** , ***like this***
262
-
263
- ```javascript
264
- app.get("/product/:productId/:productName)
265
- ```
266
-
267
- ```javascript
268
- app.get("/hello/:id/",(xl) => {
269
- const id = xl.getParams("id")
270
- const query = xl.getQuery() // you can pass query name also , you wanna get
271
- return xl.json({ msg: "Hello", id });
272
- })
273
- ```
274
-
275
-
1
+ # DieselJS
2
+
3
+ **made only for bun***
4
+
5
+ **Diesel** is a simple and lightweight HTTP server library for Bun.js that provides you with complete control over your API routes and middleware. It is designed to be intuitive and efficient, allowing you to quickly set up a server, define routes, and optimize important paths for faster response times.
6
+
7
+ With built-in support for TypeScript, DieselJS ensures type safety and improved developer experience, making it easier to catch errors during development. Whether you are building a small application or a large API, DieselJS helps you manage your routes and middleware seamlessly.
8
+
9
+
10
+ ## Installation
11
+ Install diesel-core via bun | npm | yarn | pnpm
12
+
13
+ ```bash
14
+ npm install diesel-core
15
+ ```
16
+ ```bash
17
+ bun add diesel-core
18
+ ```
19
+
20
+ ### Code Example
21
+ ```javascript
22
+ import {Diesel} from "diesel-core"
23
+
24
+ const app = new Diesel()
25
+ const port = 3000
26
+
27
+ app.get("/", async (ctx:ContextType) => {
28
+ return ctx.text("Hello world...!",200)
29
+ // Note :- passing statusCode is optional
30
+ })
31
+
32
+ // Start the server
33
+ app.listen(port, () => {
34
+ console.log(`diesel is running on port ${port}`)
35
+ })
36
+ ```
37
+
38
+ # CORS
39
+
40
+ ### Diesel supports cors out of the box
41
+
42
+ ``` javascript
43
+ app.cors({
44
+ origin: ['http://localhost:5173','*'],
45
+ methods: 'GET,POST,PUT,DELETE',
46
+ allowedHeaders: 'Content-Type,Authorization'
47
+ })
48
+ ```
49
+
50
+ # Filter and Route Security
51
+ **Diesel** provides a simple way to manage public and protected routes by using a filter() method. You can define specific routes to be publicly accessible, while others will require authentication or custom middleware functions.
52
+
53
+ ### How to Use the Filter
54
+ The **filter()** method allows you to secure certain endpoints while keeping others public. You can specify routes that should be publicly accessible using permitAll(), and apply authentication or other middleware to the remaining routes with require().
55
+
56
+
57
+ ### Example Usage
58
+ ```javascript
59
+ import {Diesel} from "diesel-core";
60
+ import jwt from 'jsonwebtoken';
61
+
62
+
63
+ const app = new Diesel();
64
+
65
+ async function authJwt (ctx:ContextType, server?:Server): Promise<void | Response> {
66
+ const token = await ctx.getCookie("accessToken"); // Retrieve the JWT token from cookies
67
+ if (!token) {
68
+ return ctx.json({ message: "Authentication token missing" },401);
69
+ }
70
+ try {
71
+ // Verify the JWT token using a secret key
72
+ const user = jwt.verify(token, secret); // Replace with your JWT secret
73
+ // Set the user data in context
74
+ ctx.setUser(user);
75
+
76
+ // Proceed to the next middleware/route handler
77
+ return ctx.next();
78
+ } catch (error) {
79
+ return ctx.json({ message: "Invalid token" },403);
80
+ }
81
+ }
82
+
83
+ // Define routes and apply filter
84
+ app
85
+ .filter()
86
+ .routeMatcher('/api/user/register', '/api/user/login', '/test/:id', '/cookie') // Define public routes
87
+ .permitAll() // Mark these routes as public (no auth required)
88
+ .require(authJwt); // Apply the authJwt middleware to all other routes
89
+
90
+ // Example public route (no auth required)
91
+ app.get("/api/user/register", async (ctx:ContextType) => {
92
+ return ctx.json({ msg: "This is a public route. No authentication needed." });
93
+ });
94
+
95
+ // Example protected route (requires auth)
96
+ app.get("/api/user/profile", async (ctx:ContextType) => {
97
+ // This route is protected, so the auth middleware will run before this handler
98
+ const user = ctx.getUser()
99
+ return ctx.json({
100
+ msg: "You are authenticated!" ,
101
+ user
102
+ });
103
+ });
104
+
105
+ // Start the server
106
+ const port = 3000;
107
+ app.listen(port, () => {
108
+ console.log(`Diesel is running on port ${port}`);
109
+ })
110
+
111
+ ```
112
+ # Filter Methods
113
+ 1. **routeMatcher(...routes: string[])** : Passed endpoints in this routeMatcher will be ***Public*** means they don't need authentication, including those with dynamic parameters (e.g., /test/:id).
114
+
115
+ ```javascript
116
+ .routeMatcher('/api/user/register', '/api/user/login', '/test/:id')
117
+ ```
118
+ 1. **permitAll()** : Marks the routes specified in routeMatcher() as publicly accessible, meaning no middleware (like authentication) will be required for these routes.
119
+
120
+ ```javascript
121
+ .permitAll()
122
+ ```
123
+ 1. **require(fnc?: middlewareFunc)** :Means that defined routes in ***routeMatcher*** is public & All endpoints needs authentication.
124
+
125
+ *Note* : If you don't pass a middleware function to require(), DieselJS will throw an "Unauthorized" error by default. Ensure that you implement and pass a valid authentication function
126
+ ```javascript
127
+ .require(authJwt)
128
+ ```
129
+ ## Use Case
130
+ * **Public Routes** : Some routes ***(like /api/user/register or /api/user/login)*** are often open to all users without authentication. These routes can be specified with permitAll().
131
+
132
+ * **Protected Routes** : For other routes ***(like /api/user/profile)***, you'll want to require authentication or custom middleware. Use require(authJwt) to ensure that the user is authenticated before accessing these routes.
133
+
134
+ # Using Hooks in DieselJS
135
+
136
+ DieselJS allows you to enhance your request handling by utilizing hooks at various stages of the request lifecycle. This gives you the flexibility to execute custom logic for logging, authentication, data manipulation, and more.
137
+
138
+
139
+ ### Available Hooks
140
+
141
+ 1. **onRequest**: Triggered when a request is received.
142
+ 2. **preHandler**: Invoked just before the request handler executes.
143
+ 3. **postHandler**: Executed after the request handler completes but before sending the response.
144
+ 4. **onSend**: Called just before the response is sent to the client.
145
+ 5. **onError** : Executes if any error occurs
146
+
147
+ ### How to Define Hooks
148
+
149
+ To define hooks in your DieselJS application, you can add them directly to your `Diesel` instance. Here's how to set up and use each hook:
150
+
151
+ ### Example Usage
152
+
153
+ ```javascript
154
+
155
+ // define and onError hook
156
+
157
+ app.addHooks("onError",(error,req,url,server) => {
158
+ console.log(`error occured ${error.message}`)
159
+ // retunr new Response(......)
160
+ })
161
+
162
+ // Define an onRequest hook
163
+ app.addHooks("onRequest",(req,url,server) =>{
164
+ console.log(`Request received: ${req.method} ${url}`);
165
+ })
166
+ // you get req,url & server instance in onReq
167
+
168
+ // Define a preHandler hook
169
+ app.addHooks("preHandler",(ctx:ContextType) =>{
170
+ // Check for authentication token
171
+ const authToken = ctx.req.headers.get("Authorization");
172
+ if (!authToken) {
173
+ return new Response("Unauthorized", { status: 401 });
174
+ }
175
+ })
176
+
177
+ // Define a postHandler hook
178
+ app.addHooks('postHandler', async (ctx:ContextType) => {
179
+ console.log(`Response sent for: ${ctx.req.url}`);
180
+ });
181
+
182
+ // Define an onSend hook
183
+ app.addHooks('onSend',async (ctx, result) => {
184
+ console.log(`Sending response with status: ${result.status}`);
185
+ return result; // You can modify the response here if needed
186
+ });
187
+ ```
188
+
189
+ # Middleware example
190
+
191
+ **No Need to call NonSense *next()* in Middleware**
192
+
193
+ **just dont return , if evrything goes right**
194
+
195
+ ```javascript
196
+ async function authJwt (ctx:ContextType, server?:Server): Promise<void | Response> {
197
+
198
+ try {
199
+ const token = ctx?.getCookie("accessToken");
200
+ if (!token) {
201
+ return ctx.json({ message: "Authentication token missing" },401);
202
+ }
203
+ // Verify the JWT token using a secret key
204
+ const user = jwt.verify(token, secret);
205
+ ctx.set('user',user);
206
+ } catch (error) {
207
+ return ctx.json({ message: "Invalid token" },403);
208
+ }
209
+ }
210
+
211
+ // this is a global middleware
212
+ app.use(authJwt)
213
+
214
+ // path middleware example
215
+ app.use("/user",authJWT)
216
+
217
+ ```
218
+
219
+ # set cookies
220
+
221
+ ```javascript
222
+ app.get("/set-cookie", async(ctx:ContextType) => {
223
+ const user = {
224
+ name: "pk",
225
+ age: 22,
226
+ }
227
+
228
+ const accessToken = jwt.sign(user, secret, { expiresIn: "1d" })
229
+
230
+ const refreshToken = jwt.sign(user, secret ,{ expiresIn: "10d" })
231
+
232
+ const options = {
233
+ httpOnly: true,
234
+ secure: true,
235
+ maxAge: 24 * 60 * 60 * 1000,
236
+ sameSite: "Strict",
237
+ path: "/",
238
+ }
239
+
240
+ ctx
241
+ .setCookie("accessToken", accessToken, options)
242
+ .setCookie("refreshToken", refreshToken, options)
243
+
244
+ return ctx.json({msg:"setting cookies"})
245
+ })
246
+ ```
247
+
248
+ # Render a HTML page
249
+ ```javascript
250
+ app.get("/render",async (ctx) => {
251
+ return ctx.file(`${import.meta.dir}/index.html`)
252
+ })
253
+ ```
254
+ # redirect
255
+ ```javascript
256
+ app.get("/redirect",(ctx:ContextType) => {
257
+ return ctx.redirect("/");
258
+ })
259
+ ```
260
+ # get params
261
+
262
+ **You can use set ***Multiparams***** , ***like this***
263
+
264
+ ```javascript
265
+ app.get("/product/:productId/:productName)
266
+ ```
267
+
268
+ ```javascript
269
+ app.get("/hello/:id/",(ctx:ContextType) => {
270
+ const id = ctx.getParams("id")
271
+ const query = ctx.getQuery() // you can pass query name also , you wanna get
272
+ return ctx.json({ msg: "Hello", id });
273
+ })
274
+ ```
275
+
276
+
package/build.js CHANGED
@@ -1,32 +1,32 @@
1
- import path from 'path';
2
- const entryPoints = [
3
- './src/main.ts',
4
- './src/ctx.ts',
5
- './src/handleRequest.ts',
6
- './src/trie.ts',
7
- './src/router.ts',
8
- './src/utils.ts'
9
- ];
10
-
11
- entryPoints.forEach(entry => {
12
- console.log(`Building: ${entry}`);
13
- try {
14
- Bun.build({
15
- entrypoints: [path.resolve(entry)],
16
- outdir: './dist',
17
- minify: true,
18
- });
19
- } catch (error) {
20
- console.error(`Failed to build ${entry}:`, error);
21
- }
22
- });
23
-
24
- // Bun.spawn(['rm','-rf','./main'])
25
-
26
- // oha test
27
- // oha -c 500 -n 100000 -H "Cookie: accessToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoicGsiLCJhZ2UiOjIyLCJpYXQiOjE3Mjk5MjQxOTQsImV4cCI6MTczMDAxMDU5NH0._dEjx5iUuOLoq15-xTPgXOemfzIPrg06Qmruiv-I5cc" http://localhost:3000/
28
-
29
- // bombardier
30
-
31
-
32
- // bombardier -c 500 -n 100000 -H "Cookie: accessToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoicGsiLCJhZ2UiOjIyLCJpYXQiOjE3Mjk5MjQxOTQsImV4cCI6MTczMDAxMDU5NH0._dEjx5iUuOLoq15-xTPgXOemfzIPrg06Qmruiv-I5cc" http://localhost:3000/
1
+ import path from 'path';
2
+ const entryPoints = [
3
+ './src/main.ts',
4
+ './src/ctx.ts',
5
+ './src/handleRequest.ts',
6
+ './src/trie.ts',
7
+ // './src/router.ts',
8
+ './src/utils.ts'
9
+ ];
10
+
11
+ entryPoints.forEach(entry => {
12
+ console.log(`Building: ${entry}`);
13
+ try {
14
+ Bun.build({
15
+ entrypoints: [path.resolve(entry)],
16
+ outdir: './dist',
17
+ minify: true,
18
+ });
19
+ } catch (error) {
20
+ console.error(`Failed to build ${entry}:`, error);
21
+ }
22
+ });
23
+
24
+ // Bun.spawn(['rm','-rf','./main'])
25
+
26
+ // oha test
27
+ // oha -c 500 -n 100000 -H "Cookie: accessToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoicGsiLCJhZ2UiOjIyLCJpYXQiOjE3Mjk5MjQxOTQsImV4cCI6MTczMDAxMDU5NH0._dEjx5iUuOLoq15-xTPgXOemfzIPrg06Qmruiv-I5cc" http://localhost:3000/
28
+
29
+ // bombardier
30
+
31
+
32
+ // bombardier -c 500 -n 100000 -H "Cookie: accessToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoicGsiLCJhZ2UiOjIyLCJpYXQiOjE3Mjk5MjQxOTQsImV4cCI6MTczMDAxMDU5NH0._dEjx5iUuOLoq15-xTPgXOemfzIPrg06Qmruiv-I5cc" http://localhost:3000/