2021-01-15 06:01:31 +13: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-25 07:21:23 +13:00
|
|
|
if (env.SELF_HOSTED) {
|
2021-01-15 06:01:31 +13:00
|
|
|
await next()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
ctx.throw(400, "Endpoint unavailable in cloud hosting.")
|
|
|
|
}
|