Skip to content

Commit

Permalink
Fix favicon in containers with unset fetch schedule (#1444)
Browse files Browse the repository at this point in the history
Signed-off-by: Marvin A. Ruder <[email protected]>
  • Loading branch information
marvinruder authored Jul 16, 2024
1 parent 74f7c5b commit 680d980
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/backend/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ server.app.set("trust proxy", 1);
*/
const staticContentPath = path.join(__dirname, "public");

/* c8 ignore next */ // This is not tested because it is only used in development servers
if (!process.env.AUTO_FETCH_SCHEDULE || process.env.NODE_ENV === "development") {
/* c8 ignore start */ // This is not tested because it is only used in development servers
if (process.env.NODE_ENV === "development")
server.app.use(
"/assets/images/favicon",
// Serve different favicons to easily distinguish between development and production servers.
Expand All @@ -77,9 +77,8 @@ if (!process.env.AUTO_FETCH_SCHEDULE || process.env.NODE_ENV === "development")
maxAge: "1 year",
}),
);
}

/* c8 ignore start */ // We do not have static resources in tests, so this middleware is not tested
// We do not have static resources in tests, so this middleware is not tested
server.app.use(
express.static(staticContentPath, {
dotfiles: "ignore",
Expand Down

0 comments on commit 680d980

Please sign in to comment.