This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"env": { | |
"browser": true, | |
"es2021": true | |
}, | |
"extends": [ | |
"airbnb-base", | |
"eslint:recommended", | |
"plugin:@typescript-eslint/eslint-recommended", | |
"plugin:@typescript-eslint/recommended" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express' | |
const app = express() | |
app.get('/', (req, res) => { | |
res.send('Hello World!') | |
}) | |
app.listen(5000, () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"build": "tsc", | |
"dev": "node ./build/index.js" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hello: string = 'Hello World!' | |
console.log(hello) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
/* Visit https://aka.ms/tsconfig.json to read more about this file */ | |
/* Language and Environment */ | |
"target": "es6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ | |
/* Modules */ | |
"module": "commonjs", /* Specify what module code is generated. */ | |
"rootDir": "./src", /* Specify the root folder within your source files. */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const options = { | |
stages: [ | |
{ duration: '2m', target: 400 }, // ramp up to 400 users | |
{ duration: '3h56m', target: 400 }, // stay at 400 for ~4 hours | |
{ duration: '2m', target: 0 }, // scale down. (optional) | |
], | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const options = { | |
stages: [ | |
{ duration: '10s', target: 100 }, // below normal load | |
{ duration: '1m', target: 100 }, | |
{ duration: '10s', target: 1400 }, // spike to 1400 users | |
{ duration: '3m', target: 1400 }, // stay at 1400 for 3 minutes | |
{ duration: '10s', target: 100 }, // scale down. Recovery stage. | |
{ duration: '3m', target: 100 }, | |
{ duration: '10s', target: 0 }, | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const options = { | |
stages: [ | |
{ duration: '2m', target: 100 }, // below normal load | |
{ duration: '5m', target: 100 }, | |
{ duration: '2m', target: 200 }, // normal load | |
{ duration: '5m', target: 200 }, | |
{ duration: '2m', target: 300 }, // around the breaking point | |
{ duration: '5m', target: 300 }, | |
{ duration: '2m', target: 400 }, // beyond the breaking point | |
{ duration: '5m', target: 400 }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const options = { | |
vus: 1, // 1 user looping for 1 minute | |
duration: '1m', | |
thresholds: { | |
http_req_duration: ['p(99)<1500'], // 99% of requests must complete below 1.5s | |
}, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const options = { | |
stages: [ | |
{ duration: '5m', target: 100 }, // simulate ramp-up of traffic from 1 to 100 users over 5 minutes. | |
{ duration: '10m', target: 100 }, // stay at 100 users for 10 minutes | |
{ duration: '5m', target: 0 }, // ramp-down to 0 users | |
], | |
thresholds: { | |
'http_req_duration': ['p(99)<1500'], // 99% of requests must complete below 1.5s | |
'logged in successfully': ['p(99)<1500'], // 99% of requests must complete below 1.5s | |
}, |