Skip to content

Commit

Permalink
test. createProxyMiddelware
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikv committed Aug 8, 2024
1 parent 921a878 commit 46360cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM navikt/node-express:18

# Workaround: får tilfeldige feil ved npm install uten neste linje
RUN npm config set unsafe-perm=true
RUN npm config set unsafe-perm=true

WORKDIR /app

Expand All @@ -10,4 +10,4 @@ COPY ./dist .
EXPOSE 3000

ENTRYPOINT ["sh", "-c"]
CMD ["node server/index.cjs"]
CMD ["DEBUG=http-proxy-middleware* node server/index.cjs"]
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"build": "esbuild src/server.ts --bundle --platform=node --outfile=../dist/server/index.cjs --packages=external",
"postbuild": "cp -r node_modules ../dist/server",
"start": "DEBUG=http-proxy-middleware* node ../dist/server/index.cjs --openssl-legacy-provider",
"start": "node ../dist/server/index.cjs --openssl-legacy-provider",
"start-ekstern": "cross-env ENABLE_EXTERNAL_MENU=true npm start",
"start-intern": "cross-env process.env.ENABLE_INTERNAL_MENU=true npm start"
},
Expand Down
3 changes: 2 additions & 1 deletion server/src/proxy/decorator-intern-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ const setup = (app: Express) => {
createProxyMiddleware({
target: process.env.MODIACONTEXTHOLDER_URL + '/modiacontextholder/redirect',
followRedirects: false,
secure: false,
changeOrigin: true,
toProxy: true,
on: {
proxyReq: (proxyReq, req) => {
console.log('request', proxyReq.host, proxyReq.path, req.headers);
Expand Down

0 comments on commit 46360cc

Please sign in to comment.