2020-10-26 18:49:33 +01:00
|
|
|
const { budibaseTempDir } = require("./utilities/budibaseDir")
|
|
|
|
const { isDev } = require("./utilities")
|
|
|
|
|
2020-07-14 10:10:01 +02:00
|
|
|
const fixPath = require("fix-path")
|
2020-10-26 18:49:33 +01:00
|
|
|
const fs = require("fs")
|
2020-06-15 18:06:54 +02:00
|
|
|
|
|
|
|
async function runServer() {
|
2020-10-26 18:49:33 +01:00
|
|
|
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."
|
2020-10-26 18:49:33 +01:00
|
|
|
)
|
|
|
|
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()
|