Allow to run server.cmd from source directory
This also enables launching server.cmd from arbitrary directories to match the behaviour of server.sh.
This commit is contained in:
parent
f5ee3ef6f0
commit
4c6e17c650
2 changed files with 35 additions and 2 deletions
|
@ -26,6 +26,12 @@ Next, download one or more [data file(s)](http://brouter.de/brouter/segments4/)
|
||||||
On Linux:
|
On Linux:
|
||||||
> ./misc/scripts/standalone/server.sh
|
> ./misc/scripts/standalone/server.sh
|
||||||
|
|
||||||
|
On Windows (using Bash):
|
||||||
|
> ./misc/scripts/standalone/server.sh
|
||||||
|
|
||||||
|
On Windows (using CMD):
|
||||||
|
> misc\scripts\standalone\server.cmd
|
||||||
|
|
||||||
|
|
||||||
Related Projects
|
Related Projects
|
||||||
================
|
================
|
||||||
|
|
|
@ -3,8 +3,35 @@
|
||||||
REM BRouter standalone server
|
REM BRouter standalone server
|
||||||
REM java -cp brouter.jar btools.brouter.RouteServer <segmentdir> <profile-map> <customprofiledir> <port> <maxthreads>
|
REM java -cp brouter.jar btools.brouter.RouteServer <segmentdir> <profile-map> <customprofiledir> <port> <maxthreads>
|
||||||
|
|
||||||
|
pushd %~dp0
|
||||||
|
|
||||||
REM maxRunningTime is the request timeout in seconds, set to 0 to disable timeout
|
REM maxRunningTime is the request timeout in seconds, set to 0 to disable timeout
|
||||||
set JAVA_OPTS=-Xmx128M -Xms128M -Xmn8M -DmaxRunningTime=300
|
set JAVA_OPTS=-Xmx128M -Xms128M -Xmn8M -DmaxRunningTime=300
|
||||||
set CLASSPATH=../brouter.jar
|
|
||||||
|
|
||||||
java %JAVA_OPTS% -cp %CLASSPATH% btools.server.RouteServer ..\segments4 ..\profiles2 ..\customprofiles 17777 1
|
REM First search in locations matching the directory structure as found in the official BRouter zip archive
|
||||||
|
set CLASSPATH=../brouter.jar
|
||||||
|
set SEGMENTSPATH=..\segments4
|
||||||
|
set PROFILESPATH=..\profiles2
|
||||||
|
set CUSTOMPROFILESPATH=..\customprofiles
|
||||||
|
|
||||||
|
REM Otherwise try to locate files inside the source checkout
|
||||||
|
if not exist "%CLASSPATH%" (
|
||||||
|
for /f "tokens=*" %%w in (
|
||||||
|
'where /R ..\..\..\brouter-server\target brouter-server*-jar-with-dependencies.jar'
|
||||||
|
) do (
|
||||||
|
set CLASSPATH=%%w
|
||||||
|
)
|
||||||
|
)
|
||||||
|
if not exist "%SEGMENTSPATH%" (
|
||||||
|
set SEGMENTSPATH=..\..\segments4
|
||||||
|
)
|
||||||
|
if not exist "%PROFILESPATH%" (
|
||||||
|
set PROFILESPATH=..\..\profiles2
|
||||||
|
)
|
||||||
|
if not exist "%CUSTOMPROFILESPATH%" (
|
||||||
|
set CUSTOMPROFILESPATH=..\..\customprofiles
|
||||||
|
)
|
||||||
|
|
||||||
|
java %JAVA_OPTS% -cp %CLASSPATH% btools.server.RouteServer "%SEGMENTSPATH%" "%PROFILESPATH%" "%CUSTOMPROFILESPATH%" 17777 1
|
||||||
|
|
||||||
|
popd
|
||||||
|
|
Loading…
Reference in a new issue