feat(apihits): added in api hits to monitor and assist for issues
This commit is contained in:
@@ -17,6 +17,7 @@ import cors from "cors";
|
||||
import { sendNotify } from "./src/pkg/utils/notify.js";
|
||||
import { toNodeHandler } from "better-auth/node";
|
||||
import { auth } from "./src/pkg/auth/auth.js";
|
||||
import { apiHitMiddleware } from "./src/pkg/middleware/apiHits.js";
|
||||
|
||||
const main = async () => {
|
||||
const env = validateEnv(process.env);
|
||||
@@ -74,6 +75,8 @@ const main = async () => {
|
||||
}
|
||||
|
||||
// global middleware
|
||||
app.set("trust proxy", true);
|
||||
app.use(apiHitMiddleware);
|
||||
app.all(basePath + "/api/auth/*splat", toNodeHandler(auth)); // sign-in sign-out
|
||||
app.use(express.json());
|
||||
|
||||
@@ -81,6 +84,7 @@ const main = async () => {
|
||||
"http://localhost:5173", // lstV2 dev
|
||||
"http://localhost:5500", // lst dev
|
||||
"http://localhost:4200", // express
|
||||
"http://localhost:4000", // prod port
|
||||
env.BETTER_AUTH_URL, // prod
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user