Clone the repo:
git clone https://github.com/BarryFoye/demo_app_njs.git
Change to the app directory:
cd demo_app_njs
Run the install dependencies script:
npm install
Then using 3 separate terminals started from the demo_app_njs directory and in the following order:
Terminal 1:
cd hidden_server
node index.js
When the hidden server starts you should see:
> Ready on http://localhost:3100
Terminal 2:
cd gateway_server
node index.js
Once you start the gateway server you should see a:
200
And if you check the hidden server (terminal 1 if you followed this guide), it should now have something like:
> Ready on http://localhost:3100
{"message":"/setCount?count=0","level":"info"}
{"message":"/incremented","level":"info"}
Terminal 3:
cd http_server
node index.js
Finally starting the http server you'll see:
> HTTP_server ready on http://localhost:8080
Open a browser on: http://localhost:8080