-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NodeJS version of osrm-routed #4604
Conversation
good idea, i think many people miss this part of the tool chain |
| route/v1/driving/1,1;1 | 400 | Coordinates must be an array of (lon/lat) pairs | | ||
| route/v1/driving/1,1;1,1,1 | 400 | Coordinates must be an array of (lon/lat) pairs | | ||
| route/v1/driving/1,1;x | 400 | Coordinates must be an array of (lon/lat) pairs | | ||
| route/v1/driving/1,1;x,y | 400 | Lng/Lat coordinates must be valid numbers | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the changes here?
@@ -47,7 +47,7 @@ class OSRMBaseLoader{ | |||
if (err) { | |||
if (retryCount < 10) { | |||
retryCount++; | |||
setTimeout(() => { tryConnect(this.scope.OSRM_PORT, retry); }, 10); | |||
setTimeout(() => { tryConnect(this.scope.OSRM_PORT, retry); }, 100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change here? Is 10s no longer enough?
@@ -96,6 +96,7 @@ Feature: Basic trip planning | |||
| waypoints | source | trips | | |||
| a,b,c,d,e,f,g,h,i,j,k,l | first | alkjihgfedcba | | |||
|
|||
@todo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why disabling this test?
std::strcpy(buffer.get(), code); | ||
std::strcat(buffer.get(), ": "); | ||
std::strcat(buffer.get(), message); | ||
throw std::logic_error(buffer.get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the last couple of lines to
const auto code = .. .value;
const auto message = .. .value;
// both are of type std::string now, see https://github.com/Project-OSRM/osrm-backend/blob/031ce72db1bdb724527096703c55741a7c7f572c/include/util/json_container.hpp#L81
throw std::logic_error{code + ": " + message}
} | ||
else | ||
{ | ||
throw std::logic_error(code_iter->second.get<osrm::json::String>().value.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic_error should have a ctor taking a std::string; the c_str is not needed here
a986a33
to
9e690c9
Compare
39e0823
to
ea27e31
Compare
Not really a big priority anymore given that docker kind of won. Also turns out going through the V8 serialization layer is not for free, so the C++ based HTTP server is actually quite a bit faster. |
Issue
This PR implements an experimental port of
osrm-routed
to NodeJS usingexpress
as the URL router.Currently a WIP - all tests pass, but a few error messages have changed, and working on it has shown that our error scenario coverage is not really very complete.
source=last
, which according to our docs, is not validosrm-routed
command-line options and generate help messageTasklist