1
0
Fork 0
mirror of synced 2024-07-02 04:50:44 +12:00
budibase/packages/server/index.js
2019-10-11 17:14:23 +01:00

25 lines
618 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}`);
})
})()