urbica / galton

Lightweight Node.js isochrone map server
https://galton.urbica.co
MIT License
271 stars 36 forks source link

Fix osrm path retrieval #206

Closed tsantanaDH closed 5 years ago

tsantanaDH commented 6 years ago

getting the first positional argument may lead into wrong behaviours, like when using PM2 to spin up an application:

$ pm2-runtime --auto-exit -i 4 index.js map.osrm

the process.argv is (if you installed node on mac osx with homebrew):

["/usr/local/Cellar/node@8/8.11.1/bin/node","/usr/local/lib/node_modules/pm2/lib/ProcessContainer.js","-i","4","index.js","map.osrm"]

and after applying minimist, config._ will look like:

["index.js","map.osrm"]

so config._[0] will point to index.js instead of map.osrm

tsantanaDH commented 5 years ago

Since PM2 is not being used anymore, I'm closing this pull request