Skip to content

Commit

Permalink
allow web.json config to override master server address
Browse files Browse the repository at this point in the history
  • Loading branch information
glennhartmann committed Sep 13, 2020
1 parent 977b188 commit cca269c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
4 changes: 3 additions & 1 deletion bin/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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');
});

Expand Down

0 comments on commit cca269c

Please sign in to comment.