import type { HttpContextContract } from "@ioc:Adonis/Core/HttpContext";
import { loggerAPI } from "App/utils/Logger";

export default class Logger {
  public async handle(
    { request, response }: HttpContextContract,
    next: () => Promise<void>
  ) {
    // code for middleware goes here. ABOVE THE NEXT CALL
    await next();
    loggerAPI(request, response, request.url())
  }
}
