Closed pyrocumulus closed 6 years ago
That's strange, especially since requests to /bridge
do work.
You could set DEBUG
to *
to enable logged in all parts of the server (including Express, which handles the HTTP request routing). Perhaps that might provide a clue what's going on.
That's what I thought as well. Setting DEBUG
to *
does provide more information, but nothing remarkable about the /api
calls. This is the output:
express:router dispatching GET /api/status +48s
express:router query : /api/status +4ms
express:router expressInit : /api/status +1ms
express:router <anonymous> : /api/status +2ms
express:router logger : /api/status +4ms
express:router jsonParser : /api/status +4ms
body-parser:json skip empty body +0ms
express:router trim prefix (/api) from url /apistatus +3ms
express:router router /api : /api/status +0ms
express:router dispatching GET /status +1ms
express:router <anonymous> : /api/status +3ms
finalhandler default 404 +1ms
morgan log request +0ms
172.17.0.1 - - [25/Nov/2017:18:16:05 +0000] "GET /api/status HTTP/1.1" 404 23 "-" "Mozilla user agent stuff"
On the other hand, the /bridge
call does a lot more stuff after the dispatching after trim prefix. nefit-easy-core
does not appear to get hit at all according to this log. Does that mean anything to you?
The finalhandler default 404
suggests that the "status" command can't be found in nefit-easy-commands
(which is used to dispatch the higher-level commands). I have no idea how that could happen, but it does explain why you're getting the 404's.
Can you try installing the package locally (not inside a Docker container) and see if it works?
FWIW, I assume that trim prefix (/api) from url /apistatus
is a typo? It should read trim prefix (/api) from url /api/status
(forward slash between "api" and "status")
Sure, haven't done node stuff before but I think I can manage and see what happens. Will try soon.
That other thing was a typo indeed, logger from docker didn't want me to copy paste the log contents to I had to do it the old way ;-)
Took me long enough, but I finally managed to run easy-server locally (from source) to check if I'd have the same problem. But then it works just as advertised. This means that the cause lies within that Docker image and (fully) within nefit-easy-http-server
.
Next step I'll try and see if I can reproduce this problem in a brand new Docker image (if I can build such a thing).
This was solved. Was a problem in the docker image.
Thanks for the update 👍🏻
Just installed this package through a docker image. The package works well as long as I use the /bridge/ endpoints. However when I try the /api/ endpoints I get the following result on every call, whatever endpoint I choose:
The resulting HTTP status code appears to be a
404
if I'm correct. I set the environment variableDEBUG
tonefit-easy-core
but that doesn't appear to give me more information. Any idea what's going wrong or how I can further test it?