Skip to content

Commit

Permalink
La til amplitude prosjekt ResearchOps
Browse files Browse the repository at this point in the history
  • Loading branch information
eilifjohansen committed Jun 10, 2024
1 parent 56d5f3d commit 6231bda
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
AMPLITUDE_100000965: ${{ secrets.AMPLITUDE_100000965 }}
AMPLITUDE_100002261: ${{ secrets.AMPLITUDE_100002261 }}
AMPLITUDE_100002287: ${{ secrets.AMPLITUDE_100002287}}
AMPLITUDE_100004171: ${{ secrets.AMPLITUDE_100004171}}
REOPS: ${{ secrets.REOPS }}
EOF
- name: Deploy to prod
Expand Down Expand Up @@ -103,6 +104,7 @@ jobs:
AMPLITUDE_100000965: ${{ secrets.AMPLITUDE_100000965 }}
AMPLITUDE_100002261: ${{ secrets.AMPLITUDE_100002261 }}
AMPLITUDE_100002287: ${{ secrets.AMPLITUDE_100002287}}
AMPLITUDE_100004171: ${{ secrets.AMPLITUDE_100004171}}
REOPS: ${{ secrets.REOPS }}
EOF
- name: Deploy to prod
Expand Down
2 changes: 2 additions & 0 deletions .nais/dev-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,7 @@ spec:
value: {{AMPLITUDE_100002261}}
- name: AMPLITUDE_100002287
value: {{AMPLITUDE_100002287}}
- name: AMPLITUDE_100004171
value: {{AMPLITUDE_100004171}}
- name: REOPS
value: {{REOPS}}
2 changes: 2 additions & 0 deletions .nais/prod-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,7 @@ spec:
value: {{AMPLITUDE_100002261}}
- name: AMPLITUDE_100002287
value: {{AMPLITUDE_100002287}}
- name: AMPLITUDE_100004171
value: {{AMPLITUDE_100004171}}
- name: REOPS
value: {{REOPS}}
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ app.get('/amplitude/100002287/api/*', (req, res) => {
amplitudeProxy(authToken, requestUrl, res)
});

// Amplitude Prosjekt: ResearchOps- prod
app.get('/amplitude/100004171/api/*', (req, res) => {
const requestUrl = req.url.replace(/\/amplitude\/100004171/, '')
const authToken = process.env.AMPLITUDE_100004171
amplitudeProxy(authToken, requestUrl, res)
});

const amplitudeProxy = (authToken, requestUrl, proxyResponse) => {
let apiUrl = "https://analytics.eu.amplitude.com";
const options = {headers: {Authorization: "Basic " + authToken}};
Expand Down

0 comments on commit 6231bda

Please sign in to comment.