feat(apihits): so i can see if what end points are being used and when and how often
This commit is contained in:
@@ -4,6 +4,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
|
||||
import { responses } from "../../../globalUtils/routeDefs/responses.js";
|
||||
import { getNotifications } from "../controller/getNotifications.js";
|
||||
import { tryCatch } from "../../../globalUtils/tryCatch.js";
|
||||
import { apiHit } from "../../../globalUtils/apiHits.js";
|
||||
|
||||
const app = new OpenAPIHono({ strict: false });
|
||||
|
||||
@@ -18,7 +19,7 @@ app.openapi(
|
||||
responses: responses(),
|
||||
}),
|
||||
async (c: any) => {
|
||||
//apiHit(c, { endpoint: `api/logger/logs` });
|
||||
apiHit(c, { endpoint: "/notifications" });
|
||||
const { data, error } = await tryCatch(getNotifications());
|
||||
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user