Using TypeScript with Node JS | Step by Step using TypeScript in a Node js App to create a REST API

preview_player
Показать описание

To follow create a folder and run npm init inside the folder, then follow steps below,
Step 1 : Install dependencies

npm install -D typescript
npm install -D tslint
npm install express -S
npm install @types/express -D

{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist"
},
"lib": ["es2015"]
}

{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"no-console":false
},
"rulesDirectory": []
}

"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},

Step 6 : run command npm start and you should see the output.
npm start

You can read step by step article here :
Рекомендации по теме
Комментарии
Автор

Perfect tutorial to start with nodejs and typescript

chakrapanisudarshan
Автор

good. Please create series of videos on react, javascript, typscript, node, express etc with real world example. Your teaching is awesome - simple, sweet and concise. expect more videos on. Thanks a lot...

bhagabatsahoo
Автор

hi, can you make a tutorial adding i18n?

rasterkub
Автор

That code is literally pure javascript...

NelsonNotFound