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 { tryCatch } from "../../../../../globalUtils/tryCatch.js";
|
||||
import { dycoConnect } from "../../../controller/specialProcesses/dyco/plcConnection.js";
|
||||
import { apiHit } from "../../../../../globalUtils/apiHits.js";
|
||||
|
||||
const app = new OpenAPIHono({ strict: false });
|
||||
|
||||
@@ -22,7 +23,7 @@ app.openapi(
|
||||
}),
|
||||
async (c) => {
|
||||
//const body = await c.req.json();
|
||||
//apiHit(c, {endpoint: `api/logger/logs/id`});
|
||||
apiHit(c, { endpoint: `dycoconnect` });
|
||||
// const authHeader = c.req.header("Authorization");
|
||||
|
||||
// const token = authHeader?.split("Bearer ")[1] || "";
|
||||
@@ -37,6 +38,7 @@ app.openapi(
|
||||
// }
|
||||
|
||||
const { data, error } = await tryCatch(dycoConnect());
|
||||
|
||||
const dataError: any = error;
|
||||
if (error) {
|
||||
return c.json({
|
||||
|
||||
Reference in New Issue
Block a user