mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
More error resistant module loading
This commit is contained in:
parent
b2310213b3
commit
bca8fa097d
1 changed files with 8 additions and 4 deletions
|
@ -67,10 +67,14 @@ const app = express()
|
||||||
|
|
||||||
Object.keys(modules).forEach(function (k, i) {
|
Object.keys(modules).forEach(function (k, i) {
|
||||||
let x = modules[k]
|
let x = modules[k]
|
||||||
|
try {
|
||||||
x.app = require(x.path).app
|
x.app = require(x.path).app
|
||||||
x.urls.forEach((url) => {
|
x.urls.forEach((url) => {
|
||||||
app.use(vhost(url, x.app))
|
app.use(vhost(url, x.app))
|
||||||
})
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const locLogFile = './stats/logs'
|
const locLogFile = './stats/logs'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue