TypeScript-Node-Starter
TypeScript-Node-Starter copied to clipboard
Added "strict" to project.
trafficstars
Instead of using process.env.VARIABLE, export uppercase variables. process.env.VARIABLE is interpreted as "string | undefined" causing compiler errors.
.env.example
- change the SESSION_SECRET to pass "code spell checker"
- add NODE_ENV
- add SENDGRID
- add TZ to set timezone to UTC
- change MONGODB_URI to MONGODB_URI_PROD to distinguish it from MONGODB_URI_LOCAL
tsconfig.json
- add strict to the entire project
src/app.ts
- specify param types
- check for possible undefined
src/config/passport.ts
- stop using process.env
- check for possible undefined
- Set type for user parameter
- Remove "any" from serializeUser definition
src/controller/api.ts
- test for nullable token
src/controller/contact.ts
- stop using process.env
src/controller/user.ts
- stop using process.env
- check for possible undefined
src/model/user.ts
- fix bcrypt params
- fix comparePasswordFunction params
src/util/logger.ts
- stop using process.env
src/util/secrets.ts
- stop using process.env