Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into nytt-ferie-steg
Browse files Browse the repository at this point in the history
  • Loading branch information
johannbm committed Nov 12, 2024
2 parents e6aebf8 + 5479b8b commit 6147cb1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('<Default>', () => {
expect(screen.getByText('Helg (er ikke dager med foreldrepenger)')).toBeInTheDocument();
});

it('Skal sjekke at fars kalender er korrekt', async () => {
it.skip('Skal sjekke at fars kalender er korrekt', async () => {
await applyRequestHandlers(FarSøker.parameters.msw);
render(<FarSøker />);

Expand Down
6 changes: 6 additions & 0 deletions apps/veiviser-fp-eller-es/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ export default defineConfig({
include: '**/*.{jsx,tsx}',
}),
checker({ typescript: true }),
{
name: 'crossorigin',
transformIndexHtml(html) {
return html.replace(/<link rel="stylesheet" crossorigin/g, '<link rel="stylesheet" type="text/css"');
},
},
],
base: '/foreldrepenger/foreldrepenger-eller-engangsstonad',
build: {
Expand Down
3 changes: 1 addition & 2 deletions packages/server-utils/src/frontendRoute.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fetchDecoratorHtml, injectDecoratorServerSide } from '@navikt/nav-dekoratoren-moduler/ssr/index.js';
import { addViteModeHtmlToResponse } from '@navikt/vite-mode';
import express, { Router } from 'express';
import { Router } from 'express';
import path from 'node:path';

import config from './config.js';
Expand All @@ -15,7 +15,6 @@ const dekoratørProps = {

export const setupAndServeHtml = async (router: Router) => {
// When deployed, the built frontend is copied into the public directory. If running BFF locally the index.html will not exist.
router.use(express.static('./public', { index: false }));
const spaFilePath = path.resolve('./public', 'index.html');

// Only add vite-mode to dev environment
Expand Down
5 changes: 4 additions & 1 deletion server-uinnlogget/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
logger,
serverConfig,
setupActuators,
setupAndServeHtml,
setupServerDefaults,
setupAndServeHtml
} from '@navikt/fp-server-utils';

import { configureReverseProxyApi } from './reverseProxy';
Expand All @@ -17,10 +17,13 @@ setupServerDefaults(server);
setupActuators(server);

const router = express.Router();
const publicRouter = express.Router();

// Logging i json format
server.use(logger.morganMiddleware);

publicRouter.use(express.static('./public', { index: false }));
server.use(serverConfig.app.publicPath, publicRouter);

configureReverseProxyApi(router);
// Catch all route, må være sist
Expand Down
8 changes: 6 additions & 2 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
logger,
serverConfig,
setupActuators,
setupServerDefaults,
setupAndServeHtml,
setupServerDefaults,
} from '@navikt/fp-server-utils';

import { configureReverseProxyApi } from './reverseProxy.js';
Expand All @@ -18,12 +18,16 @@ setupServerDefaults(server);
setupActuators(server);

const router = express.Router();
const publicRouter = express.Router();

// Logging i json format
server.use(logger.morganMiddleware);

server.use(validerInnkommendeIdportenToken);
// Skjermdeling krever tilgang til CSS uten å være innlogget!
publicRouter.use(express.static('./public', { index: false }));
server.use(serverConfig.app.publicPath, publicRouter);

server.use(validerInnkommendeIdportenToken);
configureReverseProxyApi(router);
// Catch all route, må være sist
setupAndServeHtml(router);
Expand Down

0 comments on commit 6147cb1

Please sign in to comment.