26 lines
627 B
JavaScript
26 lines
627 B
JavaScript
const app = require("./app")
|
|
const buildAppContext = require("./initialise/buildAppContext")
|
|
const process = require("process")
|
|
|
|
let configIsNext = false
|
|
let configPath = "./config"
|
|
for (let arg of process.argv) {
|
|
if (arg === "-c") {
|
|
configIsNext = true
|
|
}
|
|
if (configIsNext) {
|
|
configPath = arg
|
|
}
|
|
}
|
|
|
|
const config = require(configPath)
|
|
|
|
;(async () => {
|
|
// const bbContext = await buildAppContext(config(), true)
|
|
const bbContext = { config: config() }
|
|
const server = await app(bbContext)
|
|
server.on("listening", () => {
|
|
console.log(`Budibase Server listening on port ${bbContext.config.port}`)
|
|
})
|
|
})()
|