feat: integrate use of ebvalidated envs
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
import { config } from "dotenv";
|
||||
import { AniwatchAPICache } from "../config/cache.js";
|
||||
import type { MiddlewareHandler } from "hono";
|
||||
|
||||
config();
|
||||
import { env } from "../config/env.js";
|
||||
import { AniwatchAPICache } from "../config/cache.js";
|
||||
|
||||
// Define middleware to add Cache-Control header
|
||||
export const cacheControlMiddleware: MiddlewareHandler = async (c, next) => {
|
||||
const sMaxAge = process.env.ANIWATCH_API_S_MAXAGE || "60";
|
||||
const staleWhileRevalidate =
|
||||
process.env.ANIWATCH_API_STALE_WHILE_REVALIDATE || "30";
|
||||
export const cacheControl: MiddlewareHandler = async (c, next) => {
|
||||
const sMaxAge = env.ANIWATCH_API_S_MAXAGE;
|
||||
const staleWhileRevalidate = env.ANIWATCH_API_STALE_WHILE_REVALIDATE;
|
||||
|
||||
c.header(
|
||||
"Cache-Control",
|
||||
|
||||
Reference in New Issue
Block a user