Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async execute(invocation: Readonly): Promise {
const uiPath = this.opt.endpoint.toLowerCase() + "/index"
if (invocation.context.path.toLowerCase() === "/swagger.json")
return response.json(this.spec)
if (invocation.context.path.toLowerCase() === this.opt.endpoint.toLowerCase())
return response.redirect(uiPath)
if (invocation.context.path.toLowerCase() === uiPath)
return response.file(join(dist.getAbsoluteFSPath(), "index.html"))
else
return invocation.proceed()
}
}