This template is being used for the HZ HBO-ICT classes about microservices. In order to work with this template please take the following steps:
- Install or update Node and NPM. For Windows users you might consider Chocolaty and for Mac users obviously Brew. These are both package managers that will help you install and update all kinds of packages via the CLI. Highly recommended.
- Clone this repo and open to the newly created folder
- Run
npm install
to install all the packages mentioned in package.json - Run
npm run dev
to start the server. - Open your browser and go to
localhost:3010
and you will see 'hi' formatted as JSON
One note on running the command npm run dev
. We use nodemon to monitor the node server and to restart the server automatically. If we use node start.js
we have to restart the server ourselves. You could install the nodemon package globally, but in this repo we installed it locally. On Windows it might be a problem to execute the npm run dev
command because of some security reasons. You probably have to execute the following command Set-ExecutionPolicy RemoteSigned
. If you want to learn more about these policies please read the Microsoft documentation.
We use ES6 module system to import and export modules.
We save credentials to other services in a variables.env
file. This file is included in this template. However, it is common use not to include it in a public repository. There are some default key value pairs included to demonstrate its working.
You can change the ports of your server via variables.env