feat(cache): add Cache-Control middleware and update .env.example

This commit is contained in:
Abdelaziz Mahdy
2024-12-22 15:32:56 -04:00
parent 2d5377cbc5
commit f1f5db84f9
3 changed files with 23 additions and 0 deletions
+2
View File
@@ -5,6 +5,7 @@ import corsConfig from "./config/cors.js";
import { ratelimit } from "./config/ratelimit.js";
import { hianimeRouter } from "./routes/hianime.js";
import cacheControlMiddleware from "./config/cache_control_middleware.js";
import { Hono } from "hono";
import { logger } from "hono/logger";
@@ -26,6 +27,7 @@ const app = new Hono<{ Variables: AniwatchAPIVariables }>();
app.use(logger());
app.use(corsConfig);
app.use(cacheControlMiddleware);
// CAUTION: For personal deployments, "refrain" from having an env
// named "ANIWATCH_API_HOSTNAME". You may face rate limitting