Global site url source

This commit is contained in:
MrFry 2019-10-26 10:08:56 +02:00
parent 61c71e6c8d
commit d841e464f5
7 changed files with 37 additions and 17 deletions

View file

@ -68,7 +68,13 @@ const app = express()
Object.keys(modules).forEach(function (k, i) {
let x = modules[k]
try {
x.app = require(x.path).app
let mod = require(x.path)
if (mod.setup) {
mod.setup({
url: 'http://' + x.urls[0] // TODO http https or neither
})
}
x.app = mod.app
x.urls.forEach((url) => {
app.use(vhost(url, x.app))
})