diff --git a/src/config/logger.ts b/src/config/logger.ts index 2c20fa0..70e2c69 100644 --- a/src/config/logger.ts +++ b/src/config/logger.ts @@ -20,7 +20,6 @@ const loggerOptions: LoggerOptions = { }; }, }, - timestamp: pino.stdTimeFunctions.isoTime, }; export const log = pino(loggerOptions); diff --git a/src/middleware/cache.ts b/src/middleware/cache.ts index 0b80dc9..370bf22 100644 --- a/src/middleware/cache.ts +++ b/src/middleware/cache.ts @@ -1,7 +1,7 @@ import { env } from "../config/env.js"; import { AniwatchAPICache, cache } from "../config/cache.js"; import type { BlankInput } from "hono/types"; -import type { Context, MiddlewareHandler } from "hono"; +import type { Context, MiddlewareHandler, Handler } from "hono"; import type { ServerContext } from "../config/context.js"; // Define middleware to add Cache-Control header @@ -41,9 +41,10 @@ export function cacheConfigSetter(keySliceIndex: number): MiddlewareHandler { }; } +// FIXED: add explicit return type export function withCache( getData: (c: Context) => Promise -) { +): Handler { return async (c: Context) => { const cacheConfig = c.get("CACHE_CONFIG"); @@ -56,10 +57,3 @@ export function withCache( return c.json({ status: 200, data }, { status: 200 }); }; } - -// export function _withCache( -// context: Context, -// promise: Promise -// ): MiddlewareHandler { -// return async (c) => {}; -// } diff --git a/src/middleware/logging.ts b/src/middleware/logging.ts index 116ca83..49e9bde 100644 --- a/src/middleware/logging.ts +++ b/src/middleware/logging.ts @@ -3,7 +3,7 @@ import { logger as honoLogger } from "hono/logger"; import { log } from "../config/logger.js"; export const logging: MiddlewareHandler = honoLogger( - (msg: string, ...rest: string[]) => { + (msg: string, ...rest: any[]) => { log.info(msg, ...rest); } );