Add standalone run.sh and configure localhost

This commit is contained in:
Norbert Renner 2019-12-30 20:52:55 +01:00
parent 5cc99949fd
commit 12c58b70fa
4 changed files with 24 additions and 3 deletions

View file

@ -20,13 +20,13 @@
} else {
// desktop configuration
BR.conf.host = 'http://0.0.0.0:17777';
BR.conf.host = 'http://localhost:17777';
// Pre-loading selected profile disabled locally. Needs brouter-web to run on a
// local web server with the profiles in a subdirectory or allowing file access
// in the Browser (security!), see
// https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally
//BR.conf.profilesUrl = 'http://localhost:8000/profiles2/';
BR.conf.profilesUrl = 'http://localhost:8000/profiles2/';
//BR.conf.profilesUrl = 'file://YOUR_PATH_TO/profiles2/';
}

View file

@ -365,6 +365,8 @@ gulp.task('release:zip_standalone', function() {
})
);
var root = gulp.src(['resources/standalone/run.sh', 'resources/standalone/segments4']);
var serverRoot = gulp
.src(
[
@ -402,7 +404,7 @@ gulp.task('release:zip_standalone', function() {
base: '../brouter/misc/scripts/'
});
return merge(brouterWeb, serverRoot, serverProfiles, serverScripts)
return merge(brouterWeb, root, serverRoot, serverProfiles, serverScripts)
.pipe(zip(destName))
.pipe(gulp.dest('.'));
});

View file

@ -0,0 +1,15 @@
#!/bin/sh
cd "$(dirname "$0")"
# start script for standalone zip
# start BRouter server on localhost
x-terminal-emulator -T "BRouter server" -e "./standalone/local.sh"
# start HTTP server for current directory (for brouter-web and profiles)
#x-terminal-emulator -T "BRouter-Web HTTP server" -e "python -m SimpleHTTPServer 8000"
x-terminal-emulator -T "BRouter-Web HTTP server" -e "python3 -m http.server 8000 --bind localhost"
# open BRouter-Web in default browser
xdg-open http://localhost:8000/brouter-web/

View file

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore