2021-11-16 18:40:31 +01:00
|
|
|
/******************************************************
|
|
|
|
* This script just makes it easy to re-create *
|
|
|
|
* a cypress like environment for testing the backend *
|
|
|
|
******************************************************/
|
|
|
|
const path = require("path")
|
|
|
|
const tmpdir = path.join(require("os").tmpdir(), ".budibase")
|
|
|
|
|
2021-11-16 21:56:24 +01:00
|
|
|
const MAIN_PORT = "10001"
|
|
|
|
const WORKER_PORT = "10002"
|
2021-11-16 18:40:31 +01:00
|
|
|
|
|
|
|
// @ts-ignore
|
2021-11-16 21:56:24 +01:00
|
|
|
process.env.PORT = MAIN_PORT
|
2021-11-16 18:40:31 +01:00
|
|
|
process.env.BUDIBASE_API_KEY = "6BE826CB-6B30-4AEC-8777-2E90464633DE"
|
|
|
|
process.env.NODE_ENV = "cypress"
|
|
|
|
process.env.ENABLE_ANALYTICS = "false"
|
|
|
|
process.env.JWT_SECRET = "budibase"
|
|
|
|
process.env.COUCH_URL = `leveldb://${tmpdir}/.data/`
|
|
|
|
process.env.SELF_HOSTED = "1"
|
2021-11-16 21:56:24 +01:00
|
|
|
process.env.WORKER_URL = `http://localhost:${WORKER_PORT}/`
|
|
|
|
process.env.MINIO_URL = `http://localhost:${MAIN_PORT}/`
|
2021-11-16 18:40:31 +01:00
|
|
|
process.env.MINIO_ACCESS_KEY = "budibase"
|
|
|
|
process.env.MINIO_SECRET_KEY = "budibase"
|
|
|
|
process.env.COUCH_DB_USER = "budibase"
|
|
|
|
process.env.COUCH_DB_PASSWORD = "budibase"
|
|
|
|
process.env.INTERNAL_API_KEY = "budibase"
|
|
|
|
process.env.ALLOW_DEV_AUTOMATIONS = "1"
|
|
|
|
|
|
|
|
// don't make this a variable or top level require
|
|
|
|
// it will cause environment module to be loaded prematurely
|
|
|
|
const server = require("../src/app")
|
2021-11-16 21:56:24 +01:00
|
|
|
process.env.PORT = WORKER_PORT
|
2021-11-16 18:40:31 +01:00
|
|
|
const worker = require("../../worker/src/index")
|
2022-01-20 09:17:08 +01:00
|
|
|
process.env.PORT = MAIN_PORT
|