2023-12-20 17:23:31 -05:00
|
|
|
import { log } from "@server/logger";
|
2023-10-03 00:58:05 -04:00
|
|
|
|
|
|
|
export default eventHandler(async (ev) => {
|
2023-10-05 02:07:05 -04:00
|
|
|
const p = log.startTimer();
|
2023-10-03 00:58:05 -04:00
|
|
|
ev.node.res.on("close", () => {
|
2023-10-05 02:07:05 -04:00
|
|
|
p.done({
|
|
|
|
label: "http/request",
|
2023-12-29 20:53:29 -05:00
|
|
|
message: `{${ev.context.currentUser?.username || "guest"}} | ${ev.method.toLocaleUpperCase()} @ ${ev._path}`,
|
2023-10-05 02:07:05 -04:00
|
|
|
});
|
2023-10-03 00:58:05 -04:00
|
|
|
});
|
|
|
|
});
|