budibase/packages/server/src/index.js

20 lines
460 B
JavaScript
Raw Normal View History

const { resolve, join } = require("./utilities/centralPath")
2020-07-13 19:11:19 +02:00
const { homedir } = require("os")
const { app } = require("electron")
2020-07-14 10:10:01 +02:00
const fixPath = require("fix-path")
2020-06-15 18:06:54 +02:00
async function runServer() {
2020-07-13 19:11:19 +02:00
const homeDir = app ? app.getPath("home") : homedir()
const budibaseDir = join(homeDir, ".budibase")
2020-07-13 19:11:19 +02:00
process.env.BUDIBASE_DIR = budibaseDir
2020-06-15 18:06:54 +02:00
2020-07-14 10:10:01 +02:00
fixPath()
2020-07-10 17:17:04 +02:00
require("dotenv").config({ path: resolve(budibaseDir, ".env") })
2020-06-15 18:06:54 +02:00
2020-07-16 15:27:27 +02:00
require("./app")
2020-06-15 18:06:54 +02:00
}
2020-07-16 16:19:46 +02:00
runServer()