Skip to content

Commit

Permalink
Build 2.20: Added onRequest to MicroService Routing
Browse files Browse the repository at this point in the history
  • Loading branch information
robtweed committed Sep 4, 2017
1 parent 79a576e commit b5601e1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docker/package.json
@@ -1,11 +1,11 @@
{
"name": "qewd-appliance",
"version": "2.1.0",
"version": "2.19.0",
"description": "QEWD Docker appliance",
"author": "Rob Tweed <rtweed@mgateway.com>",
"main": "qewd.js",
"scripts": {
"start": "node qewd.js"
"start": "NODE_PATH=/opt/qewd/mapped node qewd.js"
},
"dependencies": {
"qewd": "",
Expand Down
9 changes: 8 additions & 1 deletion lib/microServices.js
Expand Up @@ -24,7 +24,7 @@
| limitations under the License. |
----------------------------------------------------------------------------
17 August 2017
4 September 2017
Run during master process startup (see master.js)
Sets up MicroService connections and control data structues
Expand Down Expand Up @@ -121,6 +121,13 @@ module.exports = function(services_config) {
onResponse: service.onResponse,
route: new router.routeParser(service.path)
};

if (service.onRequest) {
route.onRequest = service.onRequest;
delete route.destination; // onRequest function will determine the destination
delete route.onResponse; // onRequest's responsibility is to route to a destination which may have an onResponse
}

q.u_services.restRoutes.push(route);

// make qewd-router accessible to ewd-qoper8-express which will handle the run-time routing
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,9 +1,9 @@

{
"name": "qewd",
"version": "2.19.0",
"version": "2.20.0",
"config": {
"date": "1 September 2017"
"date": "4 September 2017"
},
"description": "Quick and Easy Web Development",
"main": "index.js",
Expand Down
4 changes: 2 additions & 2 deletions rpi-docker/package.json
@@ -1,11 +1,11 @@
{
"name": "qewd-rpi-appliance",
"version": "2.2.0",
"version": "2.19.0",
"description": "QEWD Docker Appliance for Raspberry Pi",
"author": "Rob Tweed <rtweed@mgateway.com>",
"main": "qewd.js",
"scripts": {
"start": "node qewd.js"
"start": "NODE_PATH=/opt/qewd/mapped node qewd.js"
},
"dependencies": {
"qewd": "",
Expand Down

0 comments on commit b5601e1

Please sign in to comment.