Node tour of heroes
A simple API for tour of heroes
Documentation
Prerequisites
- docker and docker compose (lastest version) Docker & Docker-Compose
- Mailgun and Sendgrid accounts
commands to get you started
- git clone and go to project folder.
- create .env file in config directory
npm install
(install packages locally, since we don't mount node_modules in container)npm run build:docker
npm run start:docker
A collection of useful commands which might be helpful
Logs
npm run logs
Linting / Code prettify
npm run lint
npm run lint:fix
npm run format:check
npm run format:fix:all
Run tests
npm run test
Create apidocs
npm run apidocs
Debug
- uncomment following line from docker-compose.yml
#- --inspect-brk=0.0.0.0
- create launch.json in .vscode folder, and copy following code
{
"version": "0.2.0",
"configurations": [{
"type": "node",
"request": "attach",
"name": "Docker: Attach to Node",
"port": 9229,
"address": "localhost",
"localRoot": "${workspaceFolder}/src",
"remoteRoot": "/api/src",
"protocol": "inspector"
}]
}
Sample .env
NODE_ENV=local
PORT=4001