2021-01-14 18:01:31 +01:00
|
|
|
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) => {
|
2021-03-24 19:21:23 +01:00
|
|
|
if (env.SELF_HOSTED) {
|
2021-01-14 18:01:31 +01:00
|
|
|
await next()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
ctx.throw(400, "Endpoint unavailable in cloud hosting.")
|
|
|
|
}
|