Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev xp rewrite fix #2013

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,16 @@ const config = {
destination: `${process.env.APP_ORIGIN}/no/nav-og-samfunn/samarbeid/for-kommunen/digisos/til-kommuner-som-onsker-a-ta-i-bruk-digital-soknad-om-okonomisk-sosialhjelp/Håndbok for innføring av digital søknad %2800B%29 12.12.19.pdf`,
permanent: false,
},
// /_/* should point to XP services. Redirect only if XP is on a different origin
...(process.env.XP_ORIGIN !== process.env.APP_ORIGIN
? [
{
source: '/_/:path*',
destination: `${process.env.XP_ORIGIN}/_/:path*`,
permanent: false,
},
]
: []),
],
rewrites: async () => [
{
Expand Down Expand Up @@ -249,15 +259,6 @@ const config = {
source: '/feilside',
destination: '/404',
},
// /_/* should point to XP services. Rewrite only if XP is on a different origin
...(process.env.XP_ORIGIN !== process.env.APP_ORIGIN
? [
{
source: '/_/:path*',
destination: `${process.env.XP_ORIGIN}/_/:path*`,
},
]
: []),
...(isLocal
? [
{
Expand Down
2 changes: 1 addition & 1 deletion server/src/server-setup/server-setup-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const serverSetupDev = (expressApp: Express, nextApp: NextServer) => {
// These paths should never redirect, to ensure the site will load correctly
// when accessed from the Content Studio editor
expressApp.all(
['/draft/*', '/archive/*', '/editor/*', '/_next/*', '/gfx/*', '/api/*'],
['/draft/*', '/archive/*', '/editor/*', '/_next/*', '/gfx/*', '/api/*', '/_/*'],
(req, res) => {
return nextRequestHandler(req, res);
}
Expand Down
Loading