Skip to content

trozlabs/service-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

service-template

A Microservice Template Project

Getting Started

Some convienience scripts have been added to the package.json file.

Standard Scripts:

  • 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.

Docker Scripts:

  • npm run docker runs a proxy server, node and database containers defined in the docker-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.

Verify Application is Running

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.

Node Chrome Debugger

  1. Open URL: chrome://inspect/#devices
  2. Click on Open dedicated DevTools for Node

You should now be able to see the logs from the node app in a Chrome console.

Optional Tools:

  • Compass: A MongoDB Client

  • MySQL Workbench: A MySQL Client

  • Insomnia A REST Client

    Backup MongoDB

    docker exec example-db-mongo sh -c 'exec mongodump -u root -p secret --archive' > ./example.archive

    Import MongoDB

    docker-compose exec -T example-db-mongo sh -c 'mongorestore --archive' < example.archive

About

A Microservice Template Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published