This is a starter template for Node.js, Express and TypeScript with CommonJS Modules.
$ git clone https://github.com/mhm13dev/node-express-ts-starter.git --depth 1 <project-name>
$ cd <project-name>
$ rm -rf .git
$ git init
$ git add .
$ git commit -m "Initial commit"
$ pnpm install
Development:
$ pnpm start:dev
Production:
$ pnpm build
$ pnpm start
You can use multiple environment variables files for different environments. Order of precedence is:
.env.development.local
,.env.production.local
,.env.test.local
(local overrides for environment specific variables).env.development
,.env.production
,.env.test
(environment specific variables).env.local
(local overrides).env
(default)
The default value of NODE_ENV
for different scripts is:
start:dev
:NODE_ENV=development
build
:NODE_ENV=production
start
:NODE_ENV=production