You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to add a simple module that provided with healthcheck functionality (actually, it's part of integration testing for ripple qewd microservices).
I started to look deeper at the problem to see why such a simple case doesn't work. After research master-express, qewd-router and qx.router logic I found the following: routes.path is used as first parameter to pass in express middleware app.use the following way
That means routes.path should be / to work correctly (see example with 2 routers on root path). However, this leads to another problem. GET /healthcheck returns {"error":"Missing authorization header"}
I found that application and expressType parameters are not passed to router here. If we update corresponding master-express and master-koa logic, this problem will be gone.
Now messageObj looks correctly
module map is initialized correctly -> moduleMap":{"healthcheck":"/opt/qewd/healthcheck"}
messageObj looks correctly to be loaded by restModules
Motivation
I'd like to add a simple module that provided with healthcheck functionality (actually, it's part of integration testing for ripple qewd microservices).
The module should look very simple:
qewd.js
healthcheck.js
Problem
It returns 404
Investigation
I started to look deeper at the problem to see why such a simple case doesn't work. After research master-express, qewd-router and qx.router logic I found the following:
routes.path
is used as first parameter to pass in express middlewareapp.use
the following wayThat means
routes.path
should be/
to work correctly (see example with 2 routers on root path). However, this leads to another problem.GET /healthcheck
returns{"error":"Missing authorization header"}
Looking at express params I found the following:
And again there are 2 problems here now
application
prop is missed for messageObj and corresponding app handler logic is not calledSolution
application
parameter when path is/
application
andexpressType
parameters are not passed to router here. If we update correspondingmaster-express
andmaster-koa
logic, this problem will be gone.Now messageObj looks correctly
moduleMap":{"healthcheck":"/opt/qewd/healthcheck"}
However, the module could not be loaded due to the problem with processing name for handler in qewd-router. This should be patched also. If it be patched for this particular case, all will work. The final
healthcheck
module code is the following: https://gist.github.com/killmenot/44f03452b04066f97baa28ad91f6e279The text was updated successfully, but these errors were encountered: