-
create main.js
-
npm init -y
-
npm i express
-
npm i typescript nodemon @types/express @types/node -D
-
tsc --init
-
change main.js to main.ts
-
uncomment "outDir": "./dist" and "rootDir": "./src" in the tsconfig.json
-
create src dir and move main.ts into src. src/main.ts
-
npm i rimraf concurrently
-
add this commands in package.json
"scripts": { "prebuild": "rimraf ./dist", "build": "npx tsc", "start": "node ./dist/main.js", "preserve": "npm run build", "serve": "concurrently \"npx tsc -w\" \"nodemon ./dist/main.js\"", "test": "echo \"Error: no test specified\" && exit 1" }, -
npm run serve
-
Notifications
You must be signed in to change notification settings - Fork 2
Datodia/ts-express
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
Simple Typescript Express setup
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published