Browse Source

make it easier to add pages at the document root

master
ansuz 4 years ago
parent
commit
32d7fc55d2
2 changed files with 14 additions and 1 deletions
  1. 10
      config.js.dist
  2. 5
      server.js

10
config.js.dist

@ -66,6 +66,16 @@ module.exports = {
*/
verbose: false,
/* Main pages
* add exceptions to the router so that we can access /privacy.html
* and other odd pages
*/
mainPages: [
'index',
'privacy',
'terms',
'about',
],
/*
You have the option of specifying an alternative storage adaptor.

5
server.js

@ -45,7 +45,10 @@ Fs.exists(__dirname + "/customize", function (e) {
// FIXME I think this is a regression caused by a recent PR
// correct this hack without breaking the contributor's intended behaviour.
app.get(/\/(privacy|index|terms)\.html/, Express.static(__dirname + '/customize.dist'));
var mainPages = config.mainPages || ['index', 'privacy', 'terms', 'about'];
var mainPagePattern = new RegExp('^\/(' + mainPages.join('|') + ').html$');
app.get(mainPagePattern, Express.static(__dirname + '/customize.dist'));
app.use("/customize", Express.static(__dirname + '/customize'));
app.use("/customize", Express.static(__dirname + '/customize.dist'));

Loading…
Cancel
Save