diff --git a/server/src/plugins/serve-robots.ts b/server/src/plugins/serve-static-files.ts similarity index 61% rename from server/src/plugins/serve-robots.ts rename to server/src/plugins/serve-static-files.ts index 10086af37..14908b060 100644 --- a/server/src/plugins/serve-robots.ts +++ b/server/src/plugins/serve-static-files.ts @@ -2,9 +2,12 @@ import fastifyPlugin from 'fastify-plugin'; export const SERVE_ROBOTS_PLUGIN_ID = 'serve-robots'; -export const serveRobotsPlugin = fastifyPlugin( +export const serveStaticFilesPlugin = fastifyPlugin( async (app) => { app.get('/robots.txt', async (_, reply) => reply.redirect('https://cdn.nav.no/klage/klang/assets/robots.txt', 301)); + app.get('/favicon.ico', async (_, reply) => + reply.redirect('https://cdn.nav.no/klage/klang/assets/favicon.ico', 301), + ); }, { fastify: '5', name: SERVE_ROBOTS_PLUGIN_ID }, ); diff --git a/server/src/server.ts b/server/src/server.ts index 5da5fe959..5d3dc2441 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -16,7 +16,7 @@ import { notFoundPlugin } from '@app/plugins/not-found'; import { oboAccessTokenPlugin } from '@app/plugins/obo-token'; import { proxyVersionPlugin } from '@app/plugins/proxy-version'; import { serveIndexPlugin } from '@app/plugins/serve-index/serve-index'; -import { serveRobotsPlugin } from '@app/plugins/serve-robots'; +import { serveStaticFilesPlugin } from '@app/plugins/serve-static-files'; import { serverTimingPlugin } from '@app/plugins/server-timing'; import { traceparentPlugin } from '@app/plugins/traceparent/traceparent'; import { processErrors } from '@app/process-errors'; @@ -53,7 +53,7 @@ fastify({ trustProxy: true, querystringParser, bodyLimit, caseSensitive: false } .register(frontendLogPlugin) .register(errorReportPlugin) .register(accessTokenPlugin) - .register(serveRobotsPlugin) + .register(serveStaticFilesPlugin) .register(oboAccessTokenPlugin) .register(apiProxyPlugin, { appNames: API_CLIENT_IDS, prefix: '/api' }) .register(localDevPlugin) diff --git a/server/types/locals.d.ts b/server/types/locals.d.ts deleted file mode 100644 index 17becd7b5..000000000 --- a/server/types/locals.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare namespace Express { - interface Locals { - sessionId: string; - } -}