Response Code Not Present
Hi I have the following request:
http://my-osrm.com/route/v1/driving/-97.36003,32.5391;-97.73023,32.45536;-97.393906,32.34613;-96.846176,32.394886;-96.632705,32.324892;-96.46804,32.08964;-96.478493,31.684307;-96.890016,31.306369;-97.107129,31.587824;-97.17273,31.580409;-97.189278,31.532813;-97.1384,31.52481;-97.742724,31.434974;-98.181201,31.061909;-98.224412,30.75886;-98.411192,30.673835;-98.24753,30.57317;-97.855318,30.401488;-97.96077,30.34827;-97.93339,30.30359;-98.081454,30.189451;-98.10217,30.00334;-97.942866,29.882925;-97.92652,29.8872;-97.652856,29.680986;-97.67014,29.88139;-97.86593,29.97435;-97.84914,30.08706;-97.825,30.17389;-97.77006,30.19015;-97.78681,30.196805;-97.829522,30.215478;-97.871857,30.200832;-97.87623,30.23506;-97.828086,30.292891;-97.75364,30.23875;-97.72607,30.23917;-97.711489,30.260523;-97.698649,30.303443;-97.72019,30.29874;-97.74002,30.33375;-97.756567,30.352184;-97.237395,31.489134;-97.354015,31.101375;-97.3692,31.07044;-97.65519,31.07874;-97.716414,31.126568;-97.73388,31.09088;-97.72103,30.68457;-97.69009,30.6343;-97.520318,30.622324;-97.38276,30.34694;-96.87245,29.90765;-97.325312,30.103462;-97.66401,30.31242;-97.69693,30.36417;-97.67129,30.40292;-97.70401,30.41727;-97.74804,30.39888;-97.764983,30.432447;-97.741846,30.442375;-97.66298,30.44065;-97.613217,30.437596;-97.55858,30.54398;-97.61508,30.497318;-97.65864,30.51953;-97.65928,30.482536;-97.72218,30.50041;-97.68717,30.56047;-97.78488,30.53285;-97.82825,30.5212;-97.84904,30.5694?overview=false&alternatives=true&steps=true&hints=;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
{
routes: [
{
legs: [
{
steps: [
{
intersections: [
{
out: 0,
entry: [
true
],
bearings: [
315
],
location: [
-97.360388,
32.538799
]
},
{
out: 3,
location: [
-97.361049,
32.539359
.......
Everything seems to look right, however I do not have a code attribute that should be present with "Ok". I'm using node-osrm with my customer server.js file I can show that code if needed as well. Any help would be appreciated.
If you're using your own server implementation, then yes, the code field will be missing - adding that field is the responsibility of osrm-routed.
PR https://github.com/Project-OSRM/osrm-backend/pull/4604 has a NodeJS re-implementation of osrm-routed and shows how this works. Take a look at this block of code in particular:
https://github.com/Project-OSRM/osrm-backend/blob/ea27e31c57167a342414913802f9d413f06e5ea7/lib/index.js#L248-L269