2020-02-03 10:24:25 +01:00
|
|
|
const app = require("./app")
|
|
|
|
const buildAppContext = require("./initialise/buildAppContext")
|
|
|
|
const process = require("process")
|
2019-10-11 18:14:23 +02:00
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
let configIsNext = false
|
|
|
|
let configPath = "./config"
|
|
|
|
for (let arg of process.argv) {
|
|
|
|
if (arg === "-c") {
|
|
|
|
configIsNext = true
|
|
|
|
}
|
|
|
|
if (configIsNext) {
|
|
|
|
configPath = arg
|
|
|
|
}
|
2019-10-11 18:14:23 +02:00
|
|
|
}
|
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
const config = require(configPath)
|
2019-06-07 15:18:10 +02:00
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
;(async () => {
|
2020-04-20 17:17:11 +02:00
|
|
|
// const bbContext = await buildAppContext(config(), true)
|
|
|
|
const bbContext = { config: config() }
|
2020-02-03 10:24:25 +01:00
|
|
|
const server = await app(bbContext)
|
|
|
|
server.on("listening", () => {
|
|
|
|
console.log(`Budibase Server listening on port ${bbContext.config.port}`)
|
|
|
|
})
|
2019-07-13 11:35:57 +02:00
|
|
|
})()
|