Skip to content

Commit

Permalink
Tok bort unødvendig kode
Browse files Browse the repository at this point in the history
  • Loading branch information
eilifjohansen committed Sep 12, 2024
1 parent 40e7f81 commit 446d294
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
4 changes: 1 addition & 3 deletions .nais/prod-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
team: team-researchops
annotations:
nginx.ingress.kubernetes.io/cors-allow-origin: "https://websta.ansatt.nav.no,https://innblikk.ansatt.nav.no,https://umami.ansatt.nav.no"
nginx.ingress.kubernetes.io/cors-allow-origin: "https://websta.ansatt.nav.no,https://innblikk.ansatt.nav.no"
nginx.ingress.kubernetes.io/enable-cors: "true"
spec:
image: {{ image }}
Expand All @@ -27,8 +27,6 @@ spec:
namespace: fugl-fonix
- application: reops-websta
namespace: team-researchops
- application: reops-umami-beta
namespace: team-researchops
outbound:
external:
- host: api.siteimprove.com
Expand Down
20 changes: 1 addition & 19 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,8 @@ app.get('/siteimprov*', (req, res) => {
});

app.get('/umami/api/*', (req, res) => {
let apiUrl = "https://umami.ansatt.nav.no/api";
req.url = req.url.replace(/\/umami\/api/, '')
if (req.url.match(/users/)) {
res.end("APIet har blitt blokkert av Team ResearchOps i NAV, ta kontakt med oss for hjelp.")
} else {
const options = {
headers: {Authorization: "Basic " + process.env.UMAMI},
};
axios.get(apiUrl + req.url, options).then(function (response) {
res.json(response.data)
}).catch(function (error) {
console.log(error)
res.end("Kunne ikke koble til Umami APIet: " + error)
});
}
});

app.get('/internumami/api/*', (req, res) => {
let apiUrl = "https://umami.intern.nav.no/api";
req.url = req.url.replace(/\/internumami\/api/, '')
req.url = req.url.replace(/\/umami\/api/, '')
if (req.url.match(/users/)) {
res.end("APIet har blitt blokkert av Team ResearchOps i NAV, ta kontakt med oss for hjelp.")
} else {
Expand Down

0 comments on commit 446d294

Please sign in to comment.