├── .env.example ├── .gitignore ├── .gitpod.yml ├── LICENSE ├── README.md ├── index.ts ├── package-lock.json ├── package.json └── tsconfig.json /.env.example: -------------------------------------------------------------------------------- 1 | # choose a port here 2 | PORT= -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | # This configuration file was automatically generated by Gitpod. 2 | # Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) 3 | # and commit this file to your remote git repository to share the goodness with others. 4 | 5 | # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart 6 | 7 | tasks: 8 | - init: npm install && npm run build 9 | command: npm run start 10 | 11 | 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Sérgio Henriques 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # simple-math-api-exercise 2 | 3 | Node.js + express + typescript math api 4 | 5 | Here's a skeleton for us to clone in the 6th fCC meetup in Ikea 6 | 7 | Clone it and start from there. 8 | 9 | ```sh 10 | npm install 11 | ``` 12 | 13 | Installs node_modules folder, what some may know it for vendors folder. Express, dotenv, typescript and all its dependencies are installed. 14 | 15 | Useful links: 16 | 17 | * [Express 4 API](https://expressjs.com/en/4x/api.html) 18 | 19 | Compile typescript to dist folder 20 | 21 | ```sh 22 | npm run build 23 | ``` 24 | 25 | Run our Math API 26 | 27 | ```sh 28 | npm run start 29 | ``` 30 | 31 | ---- 32 | 33 | Based on [Setup node express typescript server](https://blog.logrocket.com/how-to-set-up-node-typescript-express/) 34 | 35 | Start from scratch 36 | 37 | ```sh 38 | npm init -y 39 | ``` 40 | 41 | ```sh 42 | npm install express dotenv 43 | ``` 44 | 45 | ```sh 46 | npm i -D typescript @types/express @types/node 47 | ``` -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | import express, { Express, Request, Response } from 'express'; 2 | import dotenv from 'dotenv'; 3 | 4 | dotenv.config(); 5 | 6 | const app: Express = express(); 7 | const port = process.env.PORT || 8000; 8 | 9 | app.get('/', (req: Request, res: Response) => { 10 | res.json({ message: 'Hello World!' }); 11 | }); 12 | 13 | app.get('/sum/:a/:b', (req: Request, res: Response) => { 14 | const { a, b } = { a: req.params.a, b: req.params.b }; 15 | const sum = Number(a) + Number(b); 16 | res.json({ message: 'Sum Operation', operation: 'success', a, b, sum }); 17 | }); 18 | 19 | app.listen(port, () => { 20 | console.log(`Server running on port http://localhost:${port}`); 21 | }); 22 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-math-api-exercise", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "simple-math-api-exercise", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "dotenv": "^16.0.3", 13 | "express": "^4.18.2" 14 | }, 15 | "devDependencies": { 16 | "@types/express": "^4.17.17", 17 | "@types/node": "^18.15.5", 18 | "typescript": "^5.0.2" 19 | } 20 | }, 21 | "node_modules/@types/body-parser": { 22 | "version": "1.19.2", 23 | "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", 24 | "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", 25 | "dev": true, 26 | "dependencies": { 27 | "@types/connect": "*", 28 | "@types/node": "*" 29 | } 30 | }, 31 | "node_modules/@types/connect": { 32 | "version": "3.4.35", 33 | "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", 34 | "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", 35 | "dev": true, 36 | "dependencies": { 37 | "@types/node": "*" 38 | } 39 | }, 40 | "node_modules/@types/express": { 41 | "version": "4.17.17", 42 | "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", 43 | "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", 44 | "dev": true, 45 | "dependencies": { 46 | "@types/body-parser": "*", 47 | "@types/express-serve-static-core": "^4.17.33", 48 | "@types/qs": "*", 49 | "@types/serve-static": "*" 50 | } 51 | }, 52 | "node_modules/@types/express-serve-static-core": { 53 | "version": "4.17.33", 54 | "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz", 55 | "integrity": "sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==", 56 | "dev": true, 57 | "dependencies": { 58 | "@types/node": "*", 59 | "@types/qs": "*", 60 | "@types/range-parser": "*" 61 | } 62 | }, 63 | "node_modules/@types/mime": { 64 | "version": "3.0.1", 65 | "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", 66 | "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==", 67 | "dev": true 68 | }, 69 | "node_modules/@types/node": { 70 | "version": "18.15.5", 71 | "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.5.tgz", 72 | "integrity": "sha512-Ark2WDjjZO7GmvsyFFf81MXuGTA/d6oP38anyxWOL6EREyBKAxKoFHwBhaZxCfLRLpO8JgVXwqOwSwa7jRcjew==", 73 | "dev": true 74 | }, 75 | "node_modules/@types/qs": { 76 | "version": "6.9.7", 77 | "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", 78 | "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", 79 | "dev": true 80 | }, 81 | "node_modules/@types/range-parser": { 82 | "version": "1.2.4", 83 | "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", 84 | "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", 85 | "dev": true 86 | }, 87 | "node_modules/@types/serve-static": { 88 | "version": "1.15.1", 89 | "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.1.tgz", 90 | "integrity": "sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==", 91 | "dev": true, 92 | "dependencies": { 93 | "@types/mime": "*", 94 | "@types/node": "*" 95 | } 96 | }, 97 | "node_modules/accepts": { 98 | "version": "1.3.8", 99 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", 100 | "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", 101 | "dependencies": { 102 | "mime-types": "~2.1.34", 103 | "negotiator": "0.6.3" 104 | }, 105 | "engines": { 106 | "node": ">= 0.6" 107 | } 108 | }, 109 | "node_modules/array-flatten": { 110 | "version": "1.1.1", 111 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 112 | "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" 113 | }, 114 | "node_modules/body-parser": { 115 | "version": "1.20.1", 116 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", 117 | "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", 118 | "dependencies": { 119 | "bytes": "3.1.2", 120 | "content-type": "~1.0.4", 121 | "debug": "2.6.9", 122 | "depd": "2.0.0", 123 | "destroy": "1.2.0", 124 | "http-errors": "2.0.0", 125 | "iconv-lite": "0.4.24", 126 | "on-finished": "2.4.1", 127 | "qs": "6.11.0", 128 | "raw-body": "2.5.1", 129 | "type-is": "~1.6.18", 130 | "unpipe": "1.0.0" 131 | }, 132 | "engines": { 133 | "node": ">= 0.8", 134 | "npm": "1.2.8000 || >= 1.4.16" 135 | } 136 | }, 137 | "node_modules/bytes": { 138 | "version": "3.1.2", 139 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 140 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", 141 | "engines": { 142 | "node": ">= 0.8" 143 | } 144 | }, 145 | "node_modules/call-bind": { 146 | "version": "1.0.2", 147 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 148 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 149 | "dependencies": { 150 | "function-bind": "^1.1.1", 151 | "get-intrinsic": "^1.0.2" 152 | }, 153 | "funding": { 154 | "url": "https://github.com/sponsors/ljharb" 155 | } 156 | }, 157 | "node_modules/content-disposition": { 158 | "version": "0.5.4", 159 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", 160 | "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", 161 | "dependencies": { 162 | "safe-buffer": "5.2.1" 163 | }, 164 | "engines": { 165 | "node": ">= 0.6" 166 | } 167 | }, 168 | "node_modules/content-type": { 169 | "version": "1.0.5", 170 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 171 | "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", 172 | "engines": { 173 | "node": ">= 0.6" 174 | } 175 | }, 176 | "node_modules/cookie": { 177 | "version": "0.5.0", 178 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", 179 | "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", 180 | "engines": { 181 | "node": ">= 0.6" 182 | } 183 | }, 184 | "node_modules/cookie-signature": { 185 | "version": "1.0.6", 186 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 187 | "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" 188 | }, 189 | "node_modules/debug": { 190 | "version": "2.6.9", 191 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 192 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 193 | "dependencies": { 194 | "ms": "2.0.0" 195 | } 196 | }, 197 | "node_modules/depd": { 198 | "version": "2.0.0", 199 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 200 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 201 | "engines": { 202 | "node": ">= 0.8" 203 | } 204 | }, 205 | "node_modules/destroy": { 206 | "version": "1.2.0", 207 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", 208 | "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", 209 | "engines": { 210 | "node": ">= 0.8", 211 | "npm": "1.2.8000 || >= 1.4.16" 212 | } 213 | }, 214 | "node_modules/dotenv": { 215 | "version": "16.0.3", 216 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", 217 | "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", 218 | "engines": { 219 | "node": ">=12" 220 | } 221 | }, 222 | "node_modules/ee-first": { 223 | "version": "1.1.1", 224 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 225 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" 226 | }, 227 | "node_modules/encodeurl": { 228 | "version": "1.0.2", 229 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 230 | "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", 231 | "engines": { 232 | "node": ">= 0.8" 233 | } 234 | }, 235 | "node_modules/escape-html": { 236 | "version": "1.0.3", 237 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 238 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" 239 | }, 240 | "node_modules/etag": { 241 | "version": "1.8.1", 242 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 243 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", 244 | "engines": { 245 | "node": ">= 0.6" 246 | } 247 | }, 248 | "node_modules/express": { 249 | "version": "4.18.2", 250 | "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", 251 | "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", 252 | "dependencies": { 253 | "accepts": "~1.3.8", 254 | "array-flatten": "1.1.1", 255 | "body-parser": "1.20.1", 256 | "content-disposition": "0.5.4", 257 | "content-type": "~1.0.4", 258 | "cookie": "0.5.0", 259 | "cookie-signature": "1.0.6", 260 | "debug": "2.6.9", 261 | "depd": "2.0.0", 262 | "encodeurl": "~1.0.2", 263 | "escape-html": "~1.0.3", 264 | "etag": "~1.8.1", 265 | "finalhandler": "1.2.0", 266 | "fresh": "0.5.2", 267 | "http-errors": "2.0.0", 268 | "merge-descriptors": "1.0.1", 269 | "methods": "~1.1.2", 270 | "on-finished": "2.4.1", 271 | "parseurl": "~1.3.3", 272 | "path-to-regexp": "0.1.7", 273 | "proxy-addr": "~2.0.7", 274 | "qs": "6.11.0", 275 | "range-parser": "~1.2.1", 276 | "safe-buffer": "5.2.1", 277 | "send": "0.18.0", 278 | "serve-static": "1.15.0", 279 | "setprototypeof": "1.2.0", 280 | "statuses": "2.0.1", 281 | "type-is": "~1.6.18", 282 | "utils-merge": "1.0.1", 283 | "vary": "~1.1.2" 284 | }, 285 | "engines": { 286 | "node": ">= 0.10.0" 287 | } 288 | }, 289 | "node_modules/finalhandler": { 290 | "version": "1.2.0", 291 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", 292 | "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", 293 | "dependencies": { 294 | "debug": "2.6.9", 295 | "encodeurl": "~1.0.2", 296 | "escape-html": "~1.0.3", 297 | "on-finished": "2.4.1", 298 | "parseurl": "~1.3.3", 299 | "statuses": "2.0.1", 300 | "unpipe": "~1.0.0" 301 | }, 302 | "engines": { 303 | "node": ">= 0.8" 304 | } 305 | }, 306 | "node_modules/forwarded": { 307 | "version": "0.2.0", 308 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 309 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", 310 | "engines": { 311 | "node": ">= 0.6" 312 | } 313 | }, 314 | "node_modules/fresh": { 315 | "version": "0.5.2", 316 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 317 | "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", 318 | "engines": { 319 | "node": ">= 0.6" 320 | } 321 | }, 322 | "node_modules/function-bind": { 323 | "version": "1.1.1", 324 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 325 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 326 | }, 327 | "node_modules/get-intrinsic": { 328 | "version": "1.2.0", 329 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", 330 | "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", 331 | "dependencies": { 332 | "function-bind": "^1.1.1", 333 | "has": "^1.0.3", 334 | "has-symbols": "^1.0.3" 335 | }, 336 | "funding": { 337 | "url": "https://github.com/sponsors/ljharb" 338 | } 339 | }, 340 | "node_modules/has": { 341 | "version": "1.0.3", 342 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 343 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 344 | "dependencies": { 345 | "function-bind": "^1.1.1" 346 | }, 347 | "engines": { 348 | "node": ">= 0.4.0" 349 | } 350 | }, 351 | "node_modules/has-symbols": { 352 | "version": "1.0.3", 353 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 354 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", 355 | "engines": { 356 | "node": ">= 0.4" 357 | }, 358 | "funding": { 359 | "url": "https://github.com/sponsors/ljharb" 360 | } 361 | }, 362 | "node_modules/http-errors": { 363 | "version": "2.0.0", 364 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 365 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 366 | "dependencies": { 367 | "depd": "2.0.0", 368 | "inherits": "2.0.4", 369 | "setprototypeof": "1.2.0", 370 | "statuses": "2.0.1", 371 | "toidentifier": "1.0.1" 372 | }, 373 | "engines": { 374 | "node": ">= 0.8" 375 | } 376 | }, 377 | "node_modules/iconv-lite": { 378 | "version": "0.4.24", 379 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 380 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 381 | "dependencies": { 382 | "safer-buffer": ">= 2.1.2 < 3" 383 | }, 384 | "engines": { 385 | "node": ">=0.10.0" 386 | } 387 | }, 388 | "node_modules/inherits": { 389 | "version": "2.0.4", 390 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 391 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 392 | }, 393 | "node_modules/ipaddr.js": { 394 | "version": "1.9.1", 395 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 396 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", 397 | "engines": { 398 | "node": ">= 0.10" 399 | } 400 | }, 401 | "node_modules/media-typer": { 402 | "version": "0.3.0", 403 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 404 | "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", 405 | "engines": { 406 | "node": ">= 0.6" 407 | } 408 | }, 409 | "node_modules/merge-descriptors": { 410 | "version": "1.0.1", 411 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 412 | "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" 413 | }, 414 | "node_modules/methods": { 415 | "version": "1.1.2", 416 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 417 | "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", 418 | "engines": { 419 | "node": ">= 0.6" 420 | } 421 | }, 422 | "node_modules/mime": { 423 | "version": "1.6.0", 424 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 425 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 426 | "bin": { 427 | "mime": "cli.js" 428 | }, 429 | "engines": { 430 | "node": ">=4" 431 | } 432 | }, 433 | "node_modules/mime-db": { 434 | "version": "1.52.0", 435 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 436 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 437 | "engines": { 438 | "node": ">= 0.6" 439 | } 440 | }, 441 | "node_modules/mime-types": { 442 | "version": "2.1.35", 443 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 444 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 445 | "dependencies": { 446 | "mime-db": "1.52.0" 447 | }, 448 | "engines": { 449 | "node": ">= 0.6" 450 | } 451 | }, 452 | "node_modules/ms": { 453 | "version": "2.0.0", 454 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 455 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" 456 | }, 457 | "node_modules/negotiator": { 458 | "version": "0.6.3", 459 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", 460 | "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", 461 | "engines": { 462 | "node": ">= 0.6" 463 | } 464 | }, 465 | "node_modules/object-inspect": { 466 | "version": "1.12.3", 467 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", 468 | "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", 469 | "funding": { 470 | "url": "https://github.com/sponsors/ljharb" 471 | } 472 | }, 473 | "node_modules/on-finished": { 474 | "version": "2.4.1", 475 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 476 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 477 | "dependencies": { 478 | "ee-first": "1.1.1" 479 | }, 480 | "engines": { 481 | "node": ">= 0.8" 482 | } 483 | }, 484 | "node_modules/parseurl": { 485 | "version": "1.3.3", 486 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 487 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 488 | "engines": { 489 | "node": ">= 0.8" 490 | } 491 | }, 492 | "node_modules/path-to-regexp": { 493 | "version": "0.1.7", 494 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 495 | "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" 496 | }, 497 | "node_modules/proxy-addr": { 498 | "version": "2.0.7", 499 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 500 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 501 | "dependencies": { 502 | "forwarded": "0.2.0", 503 | "ipaddr.js": "1.9.1" 504 | }, 505 | "engines": { 506 | "node": ">= 0.10" 507 | } 508 | }, 509 | "node_modules/qs": { 510 | "version": "6.11.0", 511 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", 512 | "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", 513 | "dependencies": { 514 | "side-channel": "^1.0.4" 515 | }, 516 | "engines": { 517 | "node": ">=0.6" 518 | }, 519 | "funding": { 520 | "url": "https://github.com/sponsors/ljharb" 521 | } 522 | }, 523 | "node_modules/range-parser": { 524 | "version": "1.2.1", 525 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 526 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", 527 | "engines": { 528 | "node": ">= 0.6" 529 | } 530 | }, 531 | "node_modules/raw-body": { 532 | "version": "2.5.1", 533 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", 534 | "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", 535 | "dependencies": { 536 | "bytes": "3.1.2", 537 | "http-errors": "2.0.0", 538 | "iconv-lite": "0.4.24", 539 | "unpipe": "1.0.0" 540 | }, 541 | "engines": { 542 | "node": ">= 0.8" 543 | } 544 | }, 545 | "node_modules/safe-buffer": { 546 | "version": "5.2.1", 547 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 548 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 549 | "funding": [ 550 | { 551 | "type": "github", 552 | "url": "https://github.com/sponsors/feross" 553 | }, 554 | { 555 | "type": "patreon", 556 | "url": "https://www.patreon.com/feross" 557 | }, 558 | { 559 | "type": "consulting", 560 | "url": "https://feross.org/support" 561 | } 562 | ] 563 | }, 564 | "node_modules/safer-buffer": { 565 | "version": "2.1.2", 566 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 567 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 568 | }, 569 | "node_modules/send": { 570 | "version": "0.18.0", 571 | "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", 572 | "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", 573 | "dependencies": { 574 | "debug": "2.6.9", 575 | "depd": "2.0.0", 576 | "destroy": "1.2.0", 577 | "encodeurl": "~1.0.2", 578 | "escape-html": "~1.0.3", 579 | "etag": "~1.8.1", 580 | "fresh": "0.5.2", 581 | "http-errors": "2.0.0", 582 | "mime": "1.6.0", 583 | "ms": "2.1.3", 584 | "on-finished": "2.4.1", 585 | "range-parser": "~1.2.1", 586 | "statuses": "2.0.1" 587 | }, 588 | "engines": { 589 | "node": ">= 0.8.0" 590 | } 591 | }, 592 | "node_modules/send/node_modules/ms": { 593 | "version": "2.1.3", 594 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 595 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 596 | }, 597 | "node_modules/serve-static": { 598 | "version": "1.15.0", 599 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", 600 | "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", 601 | "dependencies": { 602 | "encodeurl": "~1.0.2", 603 | "escape-html": "~1.0.3", 604 | "parseurl": "~1.3.3", 605 | "send": "0.18.0" 606 | }, 607 | "engines": { 608 | "node": ">= 0.8.0" 609 | } 610 | }, 611 | "node_modules/setprototypeof": { 612 | "version": "1.2.0", 613 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 614 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 615 | }, 616 | "node_modules/side-channel": { 617 | "version": "1.0.4", 618 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", 619 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", 620 | "dependencies": { 621 | "call-bind": "^1.0.0", 622 | "get-intrinsic": "^1.0.2", 623 | "object-inspect": "^1.9.0" 624 | }, 625 | "funding": { 626 | "url": "https://github.com/sponsors/ljharb" 627 | } 628 | }, 629 | "node_modules/statuses": { 630 | "version": "2.0.1", 631 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 632 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 633 | "engines": { 634 | "node": ">= 0.8" 635 | } 636 | }, 637 | "node_modules/toidentifier": { 638 | "version": "1.0.1", 639 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 640 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 641 | "engines": { 642 | "node": ">=0.6" 643 | } 644 | }, 645 | "node_modules/type-is": { 646 | "version": "1.6.18", 647 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 648 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 649 | "dependencies": { 650 | "media-typer": "0.3.0", 651 | "mime-types": "~2.1.24" 652 | }, 653 | "engines": { 654 | "node": ">= 0.6" 655 | } 656 | }, 657 | "node_modules/typescript": { 658 | "version": "5.0.2", 659 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", 660 | "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", 661 | "dev": true, 662 | "bin": { 663 | "tsc": "bin/tsc", 664 | "tsserver": "bin/tsserver" 665 | }, 666 | "engines": { 667 | "node": ">=12.20" 668 | } 669 | }, 670 | "node_modules/unpipe": { 671 | "version": "1.0.0", 672 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 673 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", 674 | "engines": { 675 | "node": ">= 0.8" 676 | } 677 | }, 678 | "node_modules/utils-merge": { 679 | "version": "1.0.1", 680 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 681 | "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", 682 | "engines": { 683 | "node": ">= 0.4.0" 684 | } 685 | }, 686 | "node_modules/vary": { 687 | "version": "1.1.2", 688 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 689 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", 690 | "engines": { 691 | "node": ">= 0.8" 692 | } 693 | } 694 | } 695 | } 696 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simple-math-api-exercise", 3 | "version": "1.0.0", 4 | "description": "Node.js + express math api", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "tsc", 8 | "start": "node dist/index.js", 9 | "test": "echo \"Error: no test specified\" && exit 1" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/Unisergius/simple-math-api-exercise.git" 14 | }, 15 | "keywords": [], 16 | "author": "", 17 | "license": "ISC", 18 | "bugs": { 19 | "url": "https://github.com/Unisergius/simple-math-api-exercise/issues" 20 | }, 21 | "homepage": "https://github.com/Unisergius/simple-math-api-exercise#readme", 22 | "dependencies": { 23 | "dotenv": "^16.0.3", 24 | "express": "^4.18.2" 25 | }, 26 | "devDependencies": { 27 | "@types/express": "^4.17.17", 28 | "@types/node": "^18.15.5", 29 | "typescript": "^5.0.2" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 22 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 26 | 27 | /* Modules */ 28 | "module": "commonjs", /* Specify what module code is generated. */ 29 | // "rootDir": "./", /* Specify the root folder within your source files. */ 30 | // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ 31 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 32 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 33 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 34 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 35 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 36 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 37 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 38 | // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ 39 | // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ 40 | // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ 41 | // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ 42 | // "resolveJsonModule": true, /* Enable importing .json files. */ 43 | // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ 44 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 45 | 46 | /* JavaScript Support */ 47 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 48 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 49 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 50 | 51 | /* Emit */ 52 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 53 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 54 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 55 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 56 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 57 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ 58 | "outDir": "./dist", /* Specify an output folder for all emitted files. */ 59 | // "removeComments": true, /* Disable emitting comments. */ 60 | // "noEmit": true, /* Disable emitting files from a compilation. */ 61 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 62 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ 63 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 64 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 65 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 66 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 67 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 68 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 69 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 70 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 71 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 72 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 73 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 74 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 75 | 76 | /* Interop Constraints */ 77 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 78 | // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ 79 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 80 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ 81 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 82 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 83 | 84 | /* Type Checking */ 85 | "strict": true, /* Enable all strict type-checking options. */ 86 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 87 | // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 88 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 89 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 90 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 91 | // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 92 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 93 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 94 | // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 95 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 96 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 97 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 98 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 99 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 100 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 101 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 102 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 103 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 104 | 105 | /* Completeness */ 106 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 107 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 108 | } 109 | } 110 | --------------------------------------------------------------------------------