A Microservice Template Project
Some convienience scripts have been added to the package.json
file.
npm start
normal startup of Node server and assumes you've setup your own databases.npm run develop
To run Node with live reload and debugging enabled.npm run develop-break-on-startup
Same as the above command but will pause immediately on startup.
npm run docker
runs a proxy server, node and database containers defined in thedocker-compose.yml
npm run docker-detached
same as above but, runs as a background process.npm run docker-destroy
destroys docker containers and database volumes.
Check that API is running at either url. (Some options below assume you are running Docker)
- Terminal:
curl -H 'content-type: application/json' http://localhost/help
- Terminal:
curl -H 'content-type: application/json' http://localhost:3000/help
- Browser: http://localhost/help Verify the proxy container is working.
- Browser: http://localhost:3000/help API Server direct access through exposed port.
- Open URL: chrome://inspect/#devices
- Click on Open dedicated DevTools for Node
You should now be able to see the logs from the node app in a Chrome console.
-
Compass: A MongoDB Client
-
MySQL Workbench: A MySQL Client
-
Insomnia A REST Client
docker exec example-db-mongo sh -c 'exec mongodump -u root -p secret --archive' > ./example.archive
docker-compose exec -T example-db-mongo sh -c 'mongorestore --archive' < example.archive