Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const server = createServer(async (req, res) => {
const cors = new Cors(fixture.configureOptions())
const logger = new Logger({ name: 'adonis', enabled: false, level: 'trace' })
fixture.configureRequest(req)
const ctx = HttpContext.create('/', {}, logger, new Profiler({}).create(''), encryption, req, res)
await cors.handle(ctx)
if (!ctx.response.hasLazyBody) {
ctx.response.send(null)
}
ctx.response.finish()
})