Skip to content
Snippets Groups Projects
Commit 29ecb5cf authored by julian.baeume's avatar julian.baeume :pick:
Browse files

allow specification of app root

this can not only be handled on ingress level, but we need to mount the
express app also on the app root level. This basically just works out of the
box.
parent 110b3ff0
No related branches found
No related tags found
No related merge requests found
CACHE_TTL=30000
PORT=8080
LOG_LEVEL=info
APP_ROOT=/
......@@ -25,6 +25,8 @@ spec:
value: "{{ .Values.cacheTTL | int }}"
- name: LOG_LEVEL
value: "{{ .Values.logLevel }}"
- name: APP_ROOT
value: "{{ .Values.appRoot }}"
ports:
- name: http
containerPort: {{ .Values.containerPort | default 8080 }}
......
......@@ -98,3 +98,5 @@ probe:
cacheTTL: 30000
logLevel: info
manifests: []
appRoot: '/'
......@@ -3,12 +3,16 @@
import { config } from 'dotenv-defaults'
import { getLogger } from './logger.js'
import { createApp } from './createApp.js'
import express from 'express'
config()
const root = express()
const app = createApp()
// Binds and listens for connections on the specified host and port
app.listen(process.env.PORT, () => {
root.listen(process.env.PORT, () => {
getLogger().info(`manifest-service listening on port ${process.env.PORT}`)
})
root.use(process.env.APP_ROOT, app)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment