Skip to content
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

Reimplement osrm-routed in NodeJS #3832

Open
TheMarex opened this issue Mar 17, 2017 · 8 comments
Open

Reimplement osrm-routed in NodeJS #3832

TheMarex opened this issue Mar 17, 2017 · 8 comments

Comments

@TheMarex
Copy link
Member

Right now we are shipping our own implementation of:

  • HTTP request parser
  • async HTTP server
  • URL parser (including a bunch of grammars for every API)

We can get rid of most of the server/ folder by moving the code to NodeJS which already ships with production quality modules for all of this. After #3768 lands we would not induce a weird cyclic dependency anymore and this becomes feasible.

We should be able to replace most of the boost::spirit code with https://pegjs.org/.

Having this as node-express based tool would also enable us to easily integrate osrm-text-instructions and simplify hooking middle ware like authentication services into this.

@daniel-j-h
Copy link
Member

Grabbing this.

@daniel-j-h daniel-j-h self-assigned this Mar 28, 2017
@daniel-j-h daniel-j-h removed their assignment May 30, 2017
@dolsup
Copy link

dolsup commented Aug 22, 2018

+1 on this request.
I'm suffering under #3749. people say that osrm-routed is unstable and not suitable for production so use osrm node module for an alternative. but osrm is not a web server. Its interface seems like osrm.js rather than osrm-routed.
Should all the people who want to run osrm backend in production do implement a web server using osrm that works like osrm-routed?
If there were an official Node.js based server, I think it will be so helpful.

@daniel-j-h
Copy link
Member

I started this in #3887 but it got de-prioritized and now no one is working on it.

Feel free to pick it up - happy to view pull requests and guide you along.

@danpat
Copy link
Member

danpat commented Oct 14, 2022

#4604 is a later version of this - but is also a bit out of date, and I haven't worked on it in a while.

IMO, a more modern approach to this would be to create an OpenAPI schema, and automatically build a server based on that.

@DennisOSRM
Copy link
Collaborator

DennisOSRM commented Oct 14, 2022

Historical anecdote: osrm-routed wasn't meant to be the one server, but evolved from a demo given 10'ish years ago. 😁

@SiarheiFedartsou
Copy link
Member

Hey all,

I invite everyone to leave comments for #6411. It won't substitute existing osrm-routed right now as we need to address all TODOs, find and fix all bugs which we definitely have in this new implementation and find answers on a lot of questions, but it is a good start in my opinion(at least we are now running all our cucumber tests against node-osrm - it is already much better than nothing).

cc @mjjbell if you are not subscribed for this issue :)

IMO, a more modern approach to this would be to create an OpenAPI schema, and automatically build a server based on that.

Tbh I noticed this your comment only now. What do you think will be benefits of this?

@DennisOSRM
Copy link
Collaborator

It's great to explore NodeJS as an osrm-routed replacement. The routed code clearly shows its age. It would be great to learn about any performance impacts of node vs routed for simple http queries.

@SiarheiFedartsou
Copy link
Member

It would be great to learn about any performance impacts of node vs routed for simple http queries.

Posted some benchmarks in PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants