1
0
Fork 0
mirror of synced 2024-09-10 06:26:02 +12:00
budibase/packages/server/src/index.js

19 lines
440 B
JavaScript
Raw Normal View History

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