I started vroom + ors, but I cannot use optimization endpoint

I’ve already started a docker compose instance and everything seems to be running, directions api works, all health check green.

Vroom also started listening on port 3000.

But I cannot make any api calls to http://localhost:8080/ors/v2/optimization endpoint, it gives me 404 error.

Is there something else I need to setup to enable optimization?

Thanks a lot!

Hey,

when configuring vroom (or rather, vroom-express), make sure that you have the routingServers set up correctly in your config.yml, i.e. that the host and port for ors profiles are set correctly.

Then, your optimization queries should go to vroom directly, which will in turn call your configured ors instance.
You don’t have to configure a “detour” via ors :wink:

Best regards

thank you for your quick reply! Will this url work if I configured in vroom?
looks like I need to rebuild the vroom image to use ors instead of the default osrm backend

configure config.yml like this:

cliArgs:
  geometry: false # retrieve geometry (-g)
  planmode: false # run vroom in plan mode (-c) if set to true
  threads: 4 # number of threads to use (-t)
  explore: 5 # exploration level to use (0..5) (-x)
  limit: '1mb' # max request size
  logdir: '/..' # the path for the logs relative to ./src
  logsize: '100M' # max log file size for rotation
  maxlocations: 1000 # max number of jobs/shipments locations
  maxvehicles: 200 # max number of vehicles
  override: true # allow cli options override (-c, -g, -t and -x)
  path: '' # VROOM path (if not in $PATH)
  port: 3000 # expressjs port
  router: 'ors' # routing backend (osrm, libosrm or ors)
  timeout: 300000 # milli-seconds
  baseurl: '/' #base url for api
routingServers:
  osrm:
    car:
      host: '0.0.0.0'
      port: '5000'
    bike:
      host: '0.0.0.0'
      port: '5001'
    foot:
      host: '0.0.0.0'
      port: '5002'
  ors:
    driving-car:
      host: '0.0.0.0'
      port: '8080'
    driving-hgv:
      host: '0.0.0.0'
      port: '8080'
    cycling-regular:
      host: '0.0.0.0'
      port: '8080'
    cycling-mountain:
      host: '0.0.0.0'
      port: '8080'
    cycling-road:
      host: '0.0.0.0'
      port: '8080'
    cycling-electric:
      host: '0.0.0.0'
      port: '8080'
    foot-walking:
      host: '0.0.0.0'
      port: '8080'
    foot-hiking:
      host: '0.0.0.0'
      port: '8080'
  valhalla:
    auto:
      host: '0.0.0.0'
      port: '8002'
    bicycle:
      host: '0.0.0.0'
      port: '8002'
    pedestrian:
      host: '0.0.0.0'
      port: '8002'
    motorcycle:
      host: '0.0.0.0'
      port: '8002'
    motor_scooter:
      host: '0.0.0.0'
      port: '8002'
    taxi:
      host: '0.0.0.0'
      port: '8002'
    hov:
      host: '0.0.0.0'
      port: '8002'
    truck:
      host: '0.0.0.0'
      port: '8002'
    bus:
      host: '0.0.0.0'
      port: '8002'

and docker compose to this:


services:
  vroom:
    network_mode: host
    image: vroomvrp/vroom-docker:v1.11.0
    container_name: vroom
    volumes:
      - ./vroom-conf/:/conf
    environment:
      - VROOM_ROUTER=ors  # router to use, osrm, valhalla or ors
    depends_on:
      - ors

but still cannot access optimization endpoint, i can access and received response for directions api

Hey,

if your system correctly resolves host: '0.0.0.0' to localhost, then this looks like it could work.
Note, that you’ll have to query localhost:3000 for optimization queries, not …ors/v2/optimization.

Best regards