1
0
Fork 0
mirror of synced 2024-06-30 03:50:37 +12:00
budibase/packages/server/src/middleware/selfhost.js

11 lines
307 B
JavaScript

const env = require("../environment")
// if added as a middleware will stop requests unless builder is in self host mode
// or cloud is in self host
module.exports = async (ctx, next) => {
if (env.SELF_HOSTED) {
await next()
return
}
ctx.throw(400, "Endpoint unavailable in cloud hosting.")
}