budibase/packages/server/src/index.js

20 lines
445 B
JavaScript
Raw Normal View History

const { budibaseTempDir } = require("./utilities/budibaseDir")
const { isDev } = require("./utilities")
2020-07-14 10:10:01 +02:00
const fixPath = require("fix-path")
const fs = require("fs")
2020-06-15 18:06:54 +02:00
async function runServer() {
if (isDev() && !fs.existsSync(budibaseTempDir())) {
console.error(
2020-10-26 18:58:01 +01:00
"Please run a build before attempting to run server independently to fill 'tmp' directory."
)
process.exit(-1)
}
2020-06-15 18:06:54 +02:00
2020-07-14 10:10:01 +02:00
fixPath()
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()