Skip to content

Commit

Permalink
La til flere nettsider
Browse files Browse the repository at this point in the history
  • Loading branch information
eilifjohansen committed Jun 7, 2024
1 parent 177ff1c commit f9d8773
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/deploy_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ jobs:
AMPLITUDE_100003868: ${{ secrets.AMPLITUDE_100003868 }}
AMPLITUDE_100003867: ${{ secrets.AMPLITUDE_100003867 }}
AMPLITUDE_100002016: ${{ secrets.AMPLITUDE_100002016 }}
AMPLITUDE_100005528: ${{ secrets.AMPLITUDE_100005528 }}
AMPLITUDE_100002233: ${{ secrets.AMPLITUDE_100002233 }}
AMPLITUDE_100001607: ${{ secrets.AMPLITUDE_100001607 }}
AMPLITUDE_100002226: ${{ secrets.AMPLITUDE_100002226 }}
AMPLITUDE_100004122: ${{ secrets.AMPLITUDE_100004122}}
AMPLITUDE_100005544: ${{ secrets.AMPLITUDE_100005544}}
AMPLITUDE_100000251: ${{ secrets.AMPLITUDE_100000251}}
AMPLITUDE_100000965 ${{ secrets.AMPLITUDE_100000965}}
AMPLITUDE_100002261 ${{ secrets.AMPLITUDE_100002261}}
REOPS: ${{ secrets.REOPS }}
EOF
- name: Deploy to prod
Expand Down Expand Up @@ -83,6 +92,15 @@ jobs:
AMPLITUDE_100003868: ${{ secrets.AMPLITUDE_100003868 }}
AMPLITUDE_100003867: ${{ secrets.AMPLITUDE_100003867 }}
AMPLITUDE_100002016: ${{ secrets.AMPLITUDE_100002016 }}
AMPLITUDE_100005528: ${{ secrets.AMPLITUDE_100005528 }}
AMPLITUDE_100002233: ${{ secrets.AMPLITUDE_100002233 }}
AMPLITUDE_100001607: ${{ secrets.AMPLITUDE_100001607 }}
AMPLITUDE_100002226: ${{ secrets.AMPLITUDE_100002226 }}
AMPLITUDE_100004122: ${{ secrets.AMPLITUDE_100004122}}
AMPLITUDE_100005544: ${{ secrets.AMPLITUDE_100005544}}
AMPLITUDE_100000251: ${{ secrets.AMPLITUDE_100000251}}
AMPLITUDE_100000965 ${{ secrets.AMPLITUDE_100000965}}
AMPLITUDE_100002261 ${{ secrets.AMPLITUDE_100002261}}
REOPS: ${{ secrets.REOPS }}
EOF
- name: Deploy to prod
Expand Down
18 changes: 18 additions & 0 deletions .nais/dev-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,23 @@ spec:
value: {{AMPLITUDE_100003867}}
- name: AMPLITUDE_100002016
value: {{AMPLITUDE_100002016}}
- name: AMPLITUDE_100005528
value: {{AMPLITUDE_100005528}}
- name: AMPLITUDE_100002233
value: {{AMPLITUDE_100002233}}
- name: AMPLITUDE_100001607
value: {{AMPLITUDE_100001607}}
- name: AMPLITUDE_100002226
value: {{AMPLITUDE_100002226}}
- name: AMPLITUDE_100004122
value: {{AMPLITUDE_100004122}}
- name: AMPLITUDE_100005544
value: {{AMPLITUDE_100005544}}
- name: AMPLITUDE_100000251
value: {{AMPLITUDE_100000251}}
- name: AMPLITUDE_100000965
value: {{AMPLITUDE_100000965}}
- name: AMPLITUDE_100002261
value: {{AMPLITUDE_100002261}}
- name: REOPS
value: {{REOPS}}
18 changes: 18 additions & 0 deletions .nais/prod-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,23 @@ spec:
value: {{AMPLITUDE_100003867}}
- name: AMPLITUDE_100002016
value: {{AMPLITUDE_100002016}}
- name: AMPLITUDE_100005528
value: {{AMPLITUDE_100005528}}
- name: AMPLITUDE_100002233
value: {{AMPLITUDE_100002233}}
- name: AMPLITUDE_100001607
value: {{AMPLITUDE_100001607}}
- name: AMPLITUDE_100002226
value: {{AMPLITUDE_100002226}}
- name: AMPLITUDE_100004122
value: {{AMPLITUDE_100004122}}
- name: AMPLITUDE_100005544
value: {{AMPLITUDE_100005544}}
- name: AMPLITUDE_100000251
value: {{AMPLITUDE_100000251}}
- name: AMPLITUDE_100000965
value: {{AMPLITUDE_100000965}}
- name: AMPLITUDE_100002261
value: {{AMPLITUDE_100002261}}
- name: REOPS
value: {{REOPS}}
69 changes: 69 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,69 @@ app.get('/amplitude/100003867/api/*', (req, res) => {
amplitudeProxy(authToken, requestUrl, res)
});

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

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

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

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

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

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

// Amplitude Prosjekt: Det som betyr noe - prod
app.get('/amplitude/100000251/api/*', (req, res) => {
const requestUrl = req.url.replace(/\/amplitude\/100000251/, '')
const authToken = process.env.AMPLITUDE_100000251
amplitudeProxy(authToken, requestUrl, res)
});

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

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

const amplitudeProxy = (authToken, requestUrl, proxyResponse) => {
let apiUrl = "https://analytics.eu.amplitude.com";
const options = {headers: {Authorization: "Basic " + authToken}};
Expand Down Expand Up @@ -135,6 +198,12 @@ app.get('/reops', (req, res) => {
res.end("it works")
});

app.use(cors()).get('/config', (req, res) => {
let authsecret = `Basic ${Buffer.from("123:123", "utf-8").toString("base64")}`
console.log(authsecret)
res.sendStatus(200)
});

app.get("/isAlive", (req, res) => res.sendStatus(200));
app.get("/isReady", (req, res) => res.sendStatus(200));
app.get("/", (req, res) => res.sendStatus(200));
Expand Down

0 comments on commit f9d8773

Please sign in to comment.