This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

OSRM Access-Control-Allow-Origin

0

Hello,

I have been playing around with an instance OSRM old api version 4.0 with an instance of the open street map website.

I have setup OSRM with a small extract and it serves perfectly fine returning directions if requested through the browser.

When I try to send the request through my open street map website I get a 200 ok with the following error (In firefox and chrome):

XMLHttpRequest cannot load http://osrmURL/viaroute?z=14&output=json&instructions=true&loc=39.0704%2C-76.5452&loc=38.9786%2C-76.4928. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://osmwebsiteURL' is therefore not allowed access.

I must be missing something, but can't seem to find the issue.

Thanks.

asked 25 Oct '16, 13:45

Cellington's gravatar image

Cellington
21691015
accept rate: 0%


One Answer:

1

I upgraded to osrm version 4.6 (with CORS support) and now everything works great.

answered 25 Oct '16, 16:07

Cellington's gravatar image

Cellington
21691015
accept rate: 0%

Source code available on GitHub .