Skip to content

Commit 06c1c71

Browse files
feat(healthcheck): Add Healthcheck Endpoint (#466)
* add healthcheck * add launch.json to start express backend * add healthcheck request * fix url and add header * add oh dear health check secret * add oh dear health check secret for prod * set env var OH_DEAR_HEALTH_CHECK_SECRET * add OH_DEAR_HEALTH_CHECK_SECRET to example env * add envs in bruno * update requests in bruno * change to require_secret * Use 401 Co-authored-by: konstantin <[email protected]> * verify that the expected tables are present --------- Co-authored-by: konstantin <[email protected]>
1 parent 7ad9b73 commit 06c1c71

File tree

13 files changed

+174
-3
lines changed

13 files changed

+174
-3
lines changed

.example.env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ ENABLE_CORS=true
22

33
AHB_CONTAINER_NAME='uploaded-files'
44
AZURE_BLOB_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol='http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;'
5-
FORMAT_VERSION_CONTAINER_NAME=format-versions
5+
FORMAT_VERSION_CONTAINER_NAME=format-versions
6+
7+
OH_DEAR_HEALTH_CHECK_SECRET=my-secret-oh-dear-health-check-secret

.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
33
"version": "0.2.0",
44
"configurations": [
5+
{
6+
"name": "Debug Express Server",
7+
"type": "node",
8+
"request": "launch",
9+
"runtimeExecutable": "/Users/kevin/.nvm/versions/node/v20.13.1/bin/node",
10+
"program": "${workspaceFolder}/node_modules/.bin/tsx",
11+
"args": ["${workspaceFolder}/src/server.ts"],
12+
"cwd": "${workspaceFolder}",
13+
"console": "integratedTerminal",
14+
"internalConsoleOptions": "neverOpen",
15+
"restart": true,
16+
"envFile": "${workspaceFolder}/.env",
17+
"env": {
18+
"NODE_ENV": "development"
19+
},
20+
"skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/**"]
21+
},
522
{
623
"name": "ng serve",
724
"type": "chrome",

bruno/Get FormatVersions.bru

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ meta {
55
}
66

77
get {
8-
url: http://localhost:3000/formatversions
8+
url: {{host}}/api/format-versions
99
body: none
1010
auth: none
1111
}

bruno/Get all pruefis of formatversion.bru

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ meta {
55
}
66

77
get {
8-
url: localhost:4200/api/format-versions/FV2504/pruefis
8+
url: {{host}}/api/format-versions/FV2504/pruefis
99
body: none
1010
auth: none
1111
}

bruno/environments/local.bru

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vars {
2+
host: http://localhost:3000
3+
}

bruno/environments/prod.bru

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vars {
2+
host: https://ahb-tabellen.hochfrequenz.de
3+
}

bruno/environments/stage.bru

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vars {
2+
host: https://ahb-tabellen.stage.hochfrequenz.de
3+
}

bruno/health.bru

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: health
3+
type: http
4+
seq: 4
5+
}
6+
7+
get {
8+
url: {{host}}/api/health
9+
body: none
10+
auth: none
11+
}
12+
13+
headers {
14+
oh-dear-health-check-secret: my-secret-oh-dear-health-check-secret
15+
}

pulumi/Pulumi.dev.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ config:
1515
ahb-tabellen:websitesContainerStartTimeLimit: "300"
1616
azure-native:location: germanywestcentral
1717
pulumi:template: container-azure-python
18+
ahb-tabellen:ohDearHealthCheckSecret:
19+
secure: AAABAMlO2g+61udj5KO4b16Pg2ESsCmCAdj2LIvT77mrZdHkCZeANgSQz+0aBbkW

pulumi/Pulumi.prod.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ config:
1616
ahb-tabellen:websitesContainerStartTimeLimit: "300"
1717
azure-native:location: germanywestcentral
1818
pulumi:template: container-azure-python
19+
ahb-tabellen:ohDearHealthCheckSecret:
20+
secure: AAABAHVhi8bu62ZujXIZQcHtU5USavOgn5rciI24E5ahGg3CPqt3mnRktu1uovTS

0 commit comments

Comments
 (0)