Koa2 + MongoDB + TypeScript Playground
Please make sure the MongoDB service is running before starting the app!
$ npm install
$ npm start
Please refer to the folder doc for more information.
For security reason, please put the secret information in config/production.json, i.e.
{
"dbUrl": "mongodb+srv://<user>:<password>@<cluster>.bqgte.mongodb.net/<dbname>?retryWrites=true&w=majority",
"jwtSecret": "your-secret-word"
}
This file should be placed when deploying only, then run NODE_ENV=production node dist/app.js
.
-
config - organizes hierarchical configurations for your app deployments
-
koa-jwt - Koa middleware for validating JSON Web Tokens
-
koa-bodyparser - a body parser for Koa, based on co-body
-
koa-multer - handling multipart/form-data for Koa
- nodemon - Monitor for any changes in your node.js application and automatically restart the server - perfect for development