Skip to content

Commit

Permalink
Logge oppslag på kodeverk for testhensikter
Browse files Browse the repository at this point in the history
  • Loading branch information
Oddsor committed Jan 28, 2025
1 parent 9377ad8 commit f906042
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/src/proxy/labs-proxy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { Express } from 'express';
import { createProxyMiddleware } from 'http-proxy-middleware';

const simpleRequestLogger = (proxyServer: any, options: any) => {
proxyServer.on('proxyReq', (proxyReq: any, req: any, res: any) => {
console.log(`[HPM] [${req.method}] ${req.url}`);
});
};

export const setup = (app: Express) => {
const apiUrl = 'http://tiltaksgjennomforing-api-labs:8080';

Expand Down Expand Up @@ -54,6 +60,7 @@ export const setup = (app: Express) => {
ignorePath: true,
changeOrigin: true,
proxyTimeout: 2000,
plugins: [simpleRequestLogger],
}),
);

Expand Down

0 comments on commit f906042

Please sign in to comment.