1
0
Fork 0
mirror of synced 2024-06-28 11:00:55 +12:00

bugfix - require order causing env to load to early

This commit is contained in:
Michael Shanks 2020-05-14 16:26:14 +01:00
parent e6b4598c82
commit eabcb48bba

View file

@ -16,6 +16,7 @@ if (env.LOGGER !== "off") app.use(logger())
app.use(api.routes())
module.exports = async port => {
port = port || env.PORT || 4001
const server = http.createServer(app.callback())
return new Promise((resolve, reject) => {
server.on("error", e => {
@ -27,4 +28,4 @@ module.exports = async port => {
resolve(server)
})
})
}
}