refactor: add health path to middleware

This commit is contained in:
Mauricio Siu 2024-10-06 02:46:07 -06:00
parent 9e4bac1386
commit 541728805f
2 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,9 @@ const redisClient = createClient({
});
app.use(async (c, next) => {
if (c.req.path === "/health") {
return next();
}
const authHeader = c.req.header("X-API-Key");
if (process.env.API_KEY !== authHeader) {

View File

@ -12,6 +12,9 @@ const app = new Hono();
cleanQueue();
app.use(async (c, next) => {
if (c.req.path === "/health") {
return next();
}
const authHeader = c.req.header("X-API-Key");
if (process.env.API_KEY !== authHeader) {