From cca269cc8b140e702e98d34fa8c99a406f8c0d7e Mon Sep 17 00:00:00 2001 From: Glenn Hartmann Date: Sun, 13 Sep 2020 21:20:24 +0000 Subject: [PATCH] allow web.json config to override master server address --- bin/index.ejs | 2 +- bin/web.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/index.ejs b/bin/index.ejs index 11eb9efe..88975b3c 100755 --- a/bin/index.ejs +++ b/bin/index.ejs @@ -99,7 +99,7 @@ window.addEventListener('resize', resizeViewport); // merge default args with query string args - var args = ['+set', 'fs_cdn', '<%= content %>']; + var args = ['+set', 'fs_cdn', '<%= content %>', '+set', 'sv_master1', '<%= master %>']; args.push.apply(args, getQueryCommands()); ioq3.callMain(args); }; diff --git a/bin/web.js b/bin/web.js index 96b45580..8fc36220 100644 --- a/bin/web.js +++ b/bin/web.js @@ -22,7 +22,8 @@ var config = loadConfig(argv.config); function loadConfig(configPath) { var config = { port: 8080, - content: 'localhost:9000' + content: 'localhost:9000', + master: 'master.quakejs.com' }; try { @@ -45,6 +46,7 @@ function loadConfig(configPath) { app.use(express.static(path.join(__dirname, '..', 'build'))); app.use(function (req, res, next) { res.locals.content = config.content; + res.locals.master = config.master; res.render('index'); });