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 { responses } from "../../../globalUtils/routeDefs/responses.js";
|
||||
import { authMiddleware } from "../../auth/middleware/authMiddleware.js";
|
||||
import { sendEmail } from "../controller/sendMail.js";
|
||||
import { tryCatch } from "../../../globalUtils/tryCatch.js";
|
||||
import { apiHit } from "../../../globalUtils/apiHits.js";
|
||||
|
||||
const app = new OpenAPIHono({ strict: false });
|
||||
|
||||
@@ -41,6 +42,7 @@ app.openapi(
|
||||
const { data: bodyData, error: bodyError } = await tryCatch(
|
||||
c.req.json()
|
||||
);
|
||||
apiHit(c, { endpoint: "/sendmail", lastBody: bodyData });
|
||||
if (bodyError) {
|
||||
return c.json(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user