-
Getting started:
- Using Google Cloud Shell (the simplest option):
prerequisites: node and npm
these are available inside Google Cloud Shell.- open two separate terminal sessions:
- check that your Project Id is shown in yellow/gold in parentheses.
- in one terminal cd sample-master/internal
- in the other terminal cd sample-master/external
- run npm install in each terminal
- run node server.js in the internal terminal
- run npm start in the external terminal
- click on the "preview" button of your Cloud Shell.
- open two separate terminal sessions:
- Alternatively, using Your own machine (Windows users, see note at bottom this file):
prerequisites: node and npm- open two separate terminal sessions:
- in one terminal cd sample-master/internal
- in the other terminal cd sample-master/external
- run npm install in each terminal
- run node server.js in the internal terminal
- run npm start in the external terminal
- Open a browser and navigate to http://localhost:8080
- open two separate terminal sessions:
- Using Google Cloud Shell (the simplest option):
-
The sample app
Uses nodejs with the express web server on both server and client microservices.
The internal service receives REST requests on port 8082 and returns mock data.
The external service unpacks json from the internal service into a html template in the Views folder and returns it to the browser on port 8080. -
Dependencies
The internal and external both use the following npm packages:- express: a web server
- body-parser to convert json and form data in the request into parameters.
- mocha, chai and supertest (for unit testing)
- nyc for code coverage reporting
The external service uses the following additional libraries:
- express-handlebars ( a templating library)
- nock (for mocking the api call)
-
Windows The external/package.json file uses linux-style syntax for environment variables. Windows users will need to modify the code in order to run the sample locally during development, e.g.
-
**"start": "set SERVER=http://localhost:8082&& node server.js"**,
-
**"test": "set SERVER=http://localhost:8082&& nyc mocha"**
-
mgurkan27 / sample-master-external Goto Github PK
View Code? Open in Web Editor NEWThis project forked from bdolphin/sample-master-external