1
0
Fork 0
mirror of synced 2024-06-28 02:50:50 +12:00
budibase/packages/server/index.js
2020-02-03 09:24:25 +00:00

25 lines
583 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 server = await app(bbContext)
server.on("listening", () => {
console.log(`Budibase Server listening on port ${bbContext.config.port}`)
})
})()