diff --git a/src/index.ts b/src/index.ts index 1ec1540..503e921 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,15 +1,15 @@ import { serve } from "bun"; -import { config } from "./config"; +import faviconFile from "../favicon.ico"; import { getEmojiUrl } from "../utils/emojiHelper"; import { SlackCache } from "./cache"; +import { config } from "./config"; import dashboard from "./dashboard.html"; -import { swaggerGenerator } from "./lib/swagger-generator"; import { addCorsHeaders, corsPreflightResponse } from "./lib/cors"; -import type { RouteDefinition } from "./types/routes"; +import { swaggerGenerator } from "./lib/swagger-generator"; import { createApiRoutes } from "./routes/api-routes"; import { SlackWrapper } from "./slackWrapper"; import swagger from "./swagger.html"; -import faviconFile from "../favicon.ico"; +import type { RouteDefinition } from "./types/routes"; // Initialize SlackWrapper and Cache const slackApp = new SlackWrapper({ @@ -97,7 +97,7 @@ const legacyRoutes = { return addCorsHeaders(response); }, "/favicon.ico": async (_: Request) => { - const response = new Response(faviconFile); + const response = new Response(Bun.file(faviconFile)); return addCorsHeaders(response); }, diff --git a/src/types/assets.d.ts b/src/types/assets.d.ts new file mode 100644 index 0000000..7381a16 --- /dev/null +++ b/src/types/assets.d.ts @@ -0,0 +1,5 @@ +/** Bun's file loader resolves these imports to a path on disk */ +declare module "*.ico" { + const path: string; + export default path; +}