GithubHelp home page GithubHelp logo

hakancunier / vroom-express Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vroom-project/vroom-express

0.0 0.0 0.0 90 KB

Out of the box Node-express server to use VROOM as a web API.

License: BSD 2-Clause "Simplified" License

JavaScript 100.00%

vroom-express's Introduction

Requirements

Setup

  • Clone the repo
git clone https://github.com/VROOM-Project/vroom-express.git
cd vroom-express
git checkout v0.5.0
  • Install dependencies using npm
npm install

Usage

Run the server using:

npm start

Health check should now return a 200 HTTP status code:

curl -w "%{http_code}" http://localhost:3000/health
200

Provided everything is fine with your VROOM and routing setup, you should now be able to run queries like:

curl --header "Content-Type:application/json" --data '{"vehicles":[{"id":0,"start":[2.3526,48.8604],"end":[2.3526,48.8604]}],"jobs":[{"id":0,"location":[2.3691,48.8532]},{"id":1,"location":[2.2911,48.8566]}],"options":{"g":true}}' http://localhost:3000

See the API documentation for input syntax.

Customization

Server side

Adjust config.yml to your needs.

Optionally set VROOM_ROUTER=<router>, router being osrm (default), libosrm or ors. Using the environment variable will override the config.yml router setting.

Client side

If override is set to true in config.yml, then the vroom command-line parameters -g, -t and -x can be set dynamically per request in order to add detailed route geometry and indicators, set the number of threads and exploration level.

Set values in the json payload via the options key:

"options": {
  "g": true,
  "t": 4,
  "x": 5
}

vroom-express's People

Contributors

jcoupey avatar nilsnolde avatar sfendrich avatar groupnet avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.