1
0
Fork 0
mirror of synced 2024-09-16 17:29:39 +12:00
budibase/packages/server/src/middleware/selfhost.js

10 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.")
}