diff --git a/.env.defaults b/.env.defaults index 1e9c2b08fd252dec621e13ac9284c588337f6c87..d89fd29147e5d72ae6cf2537bac4d10ce7d65045 100644 --- a/.env.defaults +++ b/.env.defaults @@ -1,3 +1,4 @@ CACHE_TTL=30000 PORT=8080 LOG_LEVEL=info +APP_ROOT=/ diff --git a/helm/core-manifest-service/templates/deployment.yaml b/helm/core-manifest-service/templates/deployment.yaml index 5eca31e3ee20dcd40d7afad79a505d56d0b35881..e29cb76f7af4d4a04b88d2312fd7fa74b6069fab 100644 --- a/helm/core-manifest-service/templates/deployment.yaml +++ b/helm/core-manifest-service/templates/deployment.yaml @@ -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 }} diff --git a/helm/core-manifest-service/values.yaml b/helm/core-manifest-service/values.yaml index a2476fbf0b7a822e4209f5e54fd98f6813fc4200..a87d172c15d0494bc561a78a28033f53e88bdb70 100644 --- a/helm/core-manifest-service/values.yaml +++ b/helm/core-manifest-service/values.yaml @@ -98,3 +98,5 @@ probe: cacheTTL: 30000 logLevel: info +manifests: [] +appRoot: '/' diff --git a/src/index.js b/src/index.js index 84dbe3a22f15697c74a58529cc99c58b4a268039..66963028c8adf1ee01859668c33904c475f33f7f 100644 --- a/src/index.js +++ b/src/index.js @@ -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)