Skip to content

Commit 98dce89

Browse files
Implement NodeJS based server fully replicating osrm-routed
1 parent ba9cc7c commit 98dce89

File tree

7 files changed

+52
-5
lines changed

7 files changed

+52
-5
lines changed

.github/workflows/osrm-backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ jobs:
675675
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
676676
make --jobs=${JOBS}
677677
popd
678-
- run: npm link
678+
- run: cd routed-js && npm ci && npm link
679679
- run: osrm-routed-js --version
680680
- name: Run all tests
681681
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}

features/options/routed/invalid.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Feature: osrm-routed command line options: invalid options
44
Background:
55
Given the profile "testbot"
66

7+
@skip_on_routed_js
78
Scenario: osrm-routed - Non-existing option
89
When I try to run "osrm-routed --fly-me-to-the-moon"
910
Then stdout should be empty

features/testbot/snap_intersection.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ Feature: Snapping at intersections
570570
| a,f,k | ac,cf,cf,fj,kj,kj | 132.8s | 132.8 |
571571
| k,f | ik,fi,fi | 54.3s | 54.3 |
572572
| f,a | ef,ae,ae | 66.6s | 66.6 |
573-
| k,f,a | kj,fj,fj,ef,ae,ae | 141.399999999s | 141.399999999 |
573+
| k,f,a | kj,fj,fj,ef,ae,ae | 141.399999999s +- 1e-7 | 141.399999999 +- 1e-7 |
574574

575575
When I request a travel time matrix I should get
576576
| | a | f | k |
@@ -626,4 +626,4 @@ Feature: Snapping at intersections
626626
| a,f,k | ad,df,df,fj,kj,kj | 105.6s | 105.6 |
627627
| k,f | ik,fi,fi | 54.3s | 54.3 |
628628
| f,a | ef,ae,ae | 66.6s | 66.6 |
629-
| k,f,a | ik,fi,fi,ef,ae,ae | 120.899999999s | 120.899999999 |
629+
| k,f,a | ik,fi,fi,ef,ae,ae | 120.899999999s +- 1e-7 | 120.899999999 +- 1e-7 |

routed-js/package-lock.json

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

routed-js/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
"access": "public"
3737
},
3838
"devDependencies": {
39+
"@types/node": "^18.11.3",
40+
"@types/yargs": "^17.0.13",
3941
"typescript": "^4.8.4"
4042
}
4143
}

routed-js/schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,6 @@ function parseCoordinatesAndFormat(coordinatesAndFormat) {
331331
if (!coordinatesSchema(coordinates)) {
332332
throw { message: 'Invalid coordinates', code: 'InvalidQuery' };
333333
}
334-
return { coordinates, format };
334+
return { coordinates: coordinates, format };
335335
}
336336
exports.parseCoordinatesAndFormat = parseCoordinatesAndFormat;

routed-js/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,5 +353,5 @@ export function parseCoordinatesAndFormat(coordinatesAndFormat: string): { coord
353353
if (!coordinatesSchema(coordinates)) {
354354
throw {message: 'Invalid coordinates', code: 'InvalidQuery'};
355355
}
356-
return { coordinates, format };
356+
return { coordinates: coordinates as [number, number][], format };
357357
}

0 commit comments

Comments
 (0)