Skip to content

Commit

Permalink
Merge pull request #264 from navikt/winston_esm_import
Browse files Browse the repository at this point in the history
ta i bruk esm import nå som det er fikset i winston
  • Loading branch information
kenglxn authored Feb 2, 2022
2 parents 912ae1e + 068e6cd commit f4dbe8d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 27 deletions.
19 changes: 9 additions & 10 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"jsdom": "^16.7.0",
"mustache-express": "^1.3.2",
"node-fetch": "^3.1.1",
"prom-client": "^12.0.0",
"prometheus-api-metrics": "^3.1.0",
"prom-client": "^13.2.0",
"prometheus-api-metrics": "^3.2.0",
"winston": "3.4.0"
},
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import fetch from 'node-fetch';
import express from 'express';
import mustacheExpress from 'mustache-express';
import httpProxyMiddleware from "http-proxy-middleware";
import {createLogger, transports, format} from 'winston';
import jsdom from "jsdom";
import Prometheus from "prom-client";
import require from "./esm-require.js";

const {createLogger, transports, format} = require('winston');
import require from "./esm-require.js";
const apiMetricsMiddleware = require('prometheus-api-metrics');
const {JSDOM} = jsdom;
const {createProxyMiddleware} = httpProxyMiddleware;
Expand Down Expand Up @@ -115,7 +115,7 @@ app.use('/kursoversikt/api/kurs', createProxyMiddleware({
},
secure: true,
xfwd: true,
onProxyReq: (proxyReq, req, res) => {
onProxyReq: (proxyReq, _req, _res) => {
log.info("sf proxy proxyReq target: ", proxyReq.target);
},
onProxyRes: (proxyRes, req, res) => {
Expand Down
13 changes: 1 addition & 12 deletions server/start.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
#!/usr/bin/env sh

if test -d /var/run/secrets/pindena-auth;
then
for FILE in /var/run/secrets/pindena-auth
do
for line in $(cat $FILE); do
echo "- exporting `echo $line | cut -d '=' -f 1`"
export $line
done
done
fi

exec node --experimental-modules server.js
exec node server.js

0 comments on commit f4dbe8d

Please sign in to comment.