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
12
server.js
12
server.js
|
@ -67,10 +67,14 @@ const app = express()
|
|||
|
||||
Object.keys(modules).forEach(function (k, i) {
|
||||
let x = modules[k]
|
||||
x.app = require(x.path).app
|
||||
x.urls.forEach((url) => {
|
||||
app.use(vhost(url, x.app))
|
||||
})
|
||||
try {
|
||||
x.app = require(x.path).app
|
||||
x.urls.forEach((url) => {
|
||||
app.use(vhost(url, x.app))
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
})
|
||||
|
||||
const locLogFile = './stats/logs'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue