{"id":23427237,"url":"https://github.com/arrayiterator/osrm-server","last_synced_at":"2026-05-08T15:33:50.433Z","repository":{"id":158658588,"uuid":"239470955","full_name":"ArrayIterator/osrm-server","owner":"ArrayIterator","description":"Route Map Binding API","archived":false,"fork":false,"pushed_at":"2024-12-07T20:05:15.000Z","size":42930,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T12:29:09.632Z","etag":null,"topics":["logistics","map","nginx","nodejs","osm","osrm","polyline"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArrayIterator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["arrayiterator"],"liberapay":"ArrayIterator","custom":["https://www.paypal.me/pentagonal"]}},"created_at":"2020-02-10T09:16:03.000Z","updated_at":"2024-12-07T20:05:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"9aae7960-457d-4c1c-8ecc-0fbe131c1852","html_url":"https://github.com/ArrayIterator/osrm-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ArrayIterator/osrm-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrayIterator%2Fosrm-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrayIterator%2Fosrm-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrayIterator%2Fosrm-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrayIterator%2Fosrm-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArrayIterator","download_url":"https://codeload.github.com/ArrayIterator/osrm-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrayIterator%2Fosrm-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260580931,"owners_count":23031497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logistics","map","nginx","nodejs","osm","osrm","polyline"],"created_at":"2024-12-23T06:17:47.076Z","updated_at":"2026-05-08T15:33:45.398Z","avatar_url":"https://github.com/ArrayIterator.png","language":"JavaScript","funding_links":["https://github.com/sponsors/arrayiterator","https://liberapay.com/ArrayIterator","https://www.paypal.me/pentagonal"],"categories":[],"sub_categories":[],"readme":"## OSRM\nOSRM API NODEJS\n\nOSRM implementation for API.\nOpened cause no benefit from the previous company to the coder!\n\n### PRE-REQUIRES\n\n- UBUNTU Server\n\n- NodeJS ^v10\n\n- Global `node-pre-gyp`, `node-gyp`, `nodemon`\n\n\n```bash\nsudo add-apt-repository ppa:ubuntu-toolchain-r/test\n\nsudo apt-get update -y\n\nsudo apt install build-essential git cmake pkg-config \\\nlibbz2-dev libxml2-dev libzip-dev libboost-all-dev \\\nlua5.2 liblua5.2-dev libtbb-dev libstdc++-5-dev\n\n```\n\nsee [https://github.com/Project-OSRM/osrm-backend](https://github.com/Project-OSRM/osrm-backend)\n\nFollow OSRM data storage [README.md](storage/data/osrm/README.md)\n\n\n### DEPENDS NODE\n\n- osrm@^5.22.0\n- expresss@^4.1\n- maxmind@^4.1.0\n- yaml@^1.7.2\n- express-group-routes@^1.1.0\n\n### REF URI\n\n- GEOIP : [https://db-ip.com/db/lite.php](https://db-ip.com/db/lite.php)\n- OSRM : [https://github.com/Project-OSRM/](https://github.com/Project-OSRM/)\n- OSM : [https://openstreetmap.org](https://openstreetmap.org)\n- GEO JSON - see [world.geo.json](world.geo.json)\n    - [https://github.com/johan/world.geo.json](https://github.com/johan/world.geo.json)\n    - [https://github.com/datasets/geo-countries](https://github.com/datasets/geo-countries)\n    - [https://gist.github.com/ArrayIterator/015b3bbb40828513d402e397105110e3](https://gist.github.com/ArrayIterator/015b3bbb40828513d402e397105110e3)\n\n### PORT LISTEN\n\n- PORT : `5050` to `5059`\n\n### RUN DAEMON\n\n\nRunning [`osrm-server.sh`](osrm-server.sh) as daemon background service :\n\n\n```bash\nsetsid ./osrm-server.sh \u003e/dev/null 2\u003e\u00261 \u003c /dev/null \u0026\n```\n\n### REQUESTING\n\nadd header `X-Auth-Token` with with declared token to get access\n\n\n### NGINX CONFIG\n\n\n```conf\n# MAKE SURE INSTALL MOD UPSTREAM \u0026 FAIR\n# FILE $domain.vhost.conf\n# NGINX NODE UPSTREAM ADD MAX FAILS 3 \u0026 FAILED TIMEDOUT 30 SECONDS\nupstream node_proxy_osrm {\n    least_conn;\n    server 127.0.0.1:5050 max_fails=3 fail_timeout=30s;\n    server 127.0.0.1:5051 max_fails=3 fail_timeout=30s;\n    server 127.0.0.1:5052 max_fails=3 fail_timeout=30s;\n    server 127.0.0.1:5053 max_fails=3 fail_timeout=30s;\n    server 127.0.0.1:5054 max_fails=3 fail_timeout=30s;\n    server 127.0.0.1:5055 max_fails=3 fail_timeout=30s;\n    server 127.0.0.1:5056 max_fails=3 fail_timeout=30s;\n    server 127.0.0.1:5057 max_fails=3 fail_timeout=30s;\n    server 127.0.0.1:5058 max_fails=3 fail_timeout=30s;\n    server 127.0.0.1:5059 max_fails=3 fail_timeout=30s;\n    fair;\n}\n\nserver {\n    listen 80;\n    # listen 443 ssl http2;\n\n    # ssl_certificate /etc/letsencrypt/live/$domain/fullchain.pem;\n    # ssl_certificate_key /etc/letsencrypt/live/$domain/privkey.pem;\n\n    # ROOT PATH JUST TO TRY FILES\n    root /home/$user/host/$domain/public;\n\n    # SERVER NAME / DOMAIN\n    server_name $domain www.$domain;\n\n    # SET DEFAULT MIME TYPE\n    default_type text/html;\n    # ADD PROXY HEADER\n    proxy_set_header X-Forwarded-For $remote_addr;\n    # ADD REAL HOST\n    proxy_set_header Host $http_host;\n\n    # ------------------------------------------------------------\n    # ERROR HANDLER\n    # ------------------------------------------------------------\n\n    # INDEX (NOT USED) NO INDEX TO MAKE SURE HANDLE BY NGINX\n    # index '#';\n\n    # ERROR HANDLER\n    location = '/#401' {\n        default_type application/json;\n        add_header Content-Type application/json;\n        return 401 '{\n    \"message\": \"401 Unauthorized\"\n}';\n}\n    location = '/#404' {\n        default_type application/json;\n        add_header Content-Type application/json;\n        return 404 '{\n    \"message\": \"404 Not Found\"\n}';\n    }\n    location = '/#403' {\n        default_type application/json;\n        add_header Content-Type application/json;\n        return 403 '{\n    \"message\": \"403 Forbidden\"\n}';\n    }\n    location = '/#500' {\n        default_type application/json;\n        add_header Content-Type application/json;\n        return 500 '{\n    \"message\": \"500 Internal Server Error\"\n}';\n    }\n    location = '/#502' {\n        default_type application/json;\n        add_header Content-Type application/json;\n        return 502 '{\n    \"message\": \"502 Bad Gateway\"\n}';\n    }\n    location = '/#504' {\n        default_type application/json;\n        add_header Content-Type application/json;\n        return 504 '{\n    \"message\": \"504 Gateway Timeout\"\n}';\n    }\n\n    # HANDLE ERROR\n    error_page 401 '/#401';\n    error_page 404 '/#404';\n    error_page 403 '/#403';\n    error_page 500 '/#500';\n    error_page 502 '/#502';\n    error_page 504 '/#504';\n\n    # ------------------------------------------------------------\n    # LOCATIONS\n    # ------------------------------------------------------------\n\n    location @proxy {\n        proxy_pass http://node_proxy_osrm;\n    }\n\n    # HANDLE LOCATION\n    # use try_files $uri @proxy; -\u003e to prevent accessing directory as allowed url index\n    location / {\n        try_files $uri $uri/ @proxy;\n    }\n}\n\n```\n\n### AUTHOR\n\nGithub : [@ArrayIterator](https://github.com/ArrayIterator)\n\n\n### LICENSE\n\n[MIT LICENSE](LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrayiterator%2Fosrm-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farrayiterator%2Fosrm-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrayiterator%2Fosrm-server/lists"}