- Node.js 8+
- MongoDB 3.6+ (Рекомендуется 4+)
npm i
Нужно создать файл .env
с полями MONGODB_URL, JWT_SECRET
npm run dev
You will know server is running by checking the output of the command npm run dev
Connected to mongodb:YOUR_DB_CONNECTION_STRING
App is running ...
Press CTRL + C to stop the process.
Note: YOUR_DB_CONNECTION_STRING
will be your MongoDB connection string.
If you need to add more models to the project just create a new file in /models/
and use them in the controllers.
If you need to add more routes to the project just create a new file in /routes/
and add it in /routes/api.js
it will be loaded dynamically.
If you need to add more controllers to the project just create a new file in /controllers/
and use them in the routes.
npm test
You can set custom command for test at package.json
file inside scripts
property. You can also change timeout for each assertion with --timeout
parameter of mocha command.
If you need to add more test cases to the project just create a new file in /test/
and run the command.
npm run lint
You can set custom rules for eslint in .eslintrc.json
file, Added at project root.