From 8273e8b0e21427bfd47ae4c125d3330ad47256fc Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 23 Oct 2022 15:13:42 +0200 Subject: [PATCH] Implement NodeJS based server fully replicating osrm-routed --- .github/workflows/osrm-backend.yml | 4 +--- routed-js/routed.js | 2 ++ routed-js/routed.ts | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index e24d191d9..f227c7aa3 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -111,12 +111,10 @@ jobs: key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - - name: Prepare environment - run: | - npm ci --ignore-scripts - name: Compile routed-js run: | pushd routed-js + npm ci npx tsc popd ./scripts/error_on_dirty.sh diff --git a/routed-js/routed.js b/routed-js/routed.js index 73e19c46c..1cf1e3335 100755 --- a/routed-js/routed.js +++ b/routed-js/routed.js @@ -20,6 +20,7 @@ async function main() { port: { type: 'number', default: 5000, alias: 'p' }, threads: { type: 'number', alias: 't' }, shared_memory: { type: 'boolean', alias: ['shared-memory', 's'] }, + mmap: { type: 'boolean', default: false, alias: ['m'] }, algorithm: { choices: ['CH', 'CoreCH', 'MLD'], default: 'CH', alias: 'a' }, dataset_name: { type: 'string', alias: 'dataset-name' }, max_viaroute_size: { type: 'number', alias: 'max-viaroute-size', default: 500 }, @@ -48,6 +49,7 @@ async function main() { dataset_name: argv.dataset_name, algorithm: argv.algorithm, shared_memory: argv.shared_memory, + mmap_memory: argv.mmap, max_viaroute_size: argv.max_viaroute_size, max_trip_size: argv.max_trip_size, max_table_size: argv.max_table_size, diff --git a/routed-js/routed.ts b/routed-js/routed.ts index de6f2ce5f..d39caa659 100755 --- a/routed-js/routed.ts +++ b/routed-js/routed.ts @@ -18,6 +18,7 @@ async function main() { port: { type: 'number', default: 5000, alias: 'p' }, threads: { type: 'number', alias: 't' }, shared_memory: { type: 'boolean', alias: ['shared-memory', 's'] }, + mmap: { type: 'boolean', default: false, alias: ['m'] }, algorithm: { choices: ['CH', 'CoreCH', 'MLD'], default: 'CH', alias: 'a' }, dataset_name: { type: 'string', alias: 'dataset-name' }, max_viaroute_size: { type: 'number', alias: 'max-viaroute-size', default: 500 }, @@ -49,6 +50,7 @@ async function main() { dataset_name: argv.dataset_name, algorithm: argv.algorithm, shared_memory: argv.shared_memory, + mmap_memory: argv.mmap, max_viaroute_size: argv.max_viaroute_size, max_trip_size: argv.max_trip_size, max_table_size: argv.max_table_size,