diff --git a/.github/workflows/mvn-build.yml b/.github/workflows/mvn-build.yml index 8623ecf0..58d328eb 100644 --- a/.github/workflows/mvn-build.yml +++ b/.github/workflows/mvn-build.yml @@ -76,7 +76,7 @@ jobs: if: ${{ inputs.COMPONENT_TYPE == 'client' }} run: | cd ${{ inputs.COMPONENT_TYPE }}/wfprev-war/src/main/angular - npm run build -- --configuration=production + npm run build -- --configuration=production --base-href=/pub/wfprev/ - name: Copy client built files to necessary folder if: ${{ inputs.COMPONENT_TYPE == 'client' }} diff --git a/client/wfprev-war/Dockerfile b/client/wfprev-war/Dockerfile index 16c55c32..9523ae9e 100644 --- a/client/wfprev-war/Dockerfile +++ b/client/wfprev-war/Dockerfile @@ -9,6 +9,7 @@ RUN echo "Root directory contents before copy:" && ls -la / # Copy the pre-built Angular app from the local machine into the container COPY ./dist/wfprev ./dist/wfprev +# COPY src/main/angular/dist/wfprev ./dist/wfprev # Log the contents of the /app directory after copying RUN echo "App directory contents after copy:" && ls -la /app diff --git a/client/wfprev-war/backend/server.js b/client/wfprev-war/backend/server.js index 3d53bd8c..f3573cb0 100644 --- a/client/wfprev-war/backend/server.js +++ b/client/wfprev-war/backend/server.js @@ -15,10 +15,10 @@ app.use(cors()); app.use(bodyParser.json()); // Serve static files from the Angular app -app.use(express.static(path.join(__dirname, 'dist/wfprev'))); +app.use('/pub/wfprev', express.static(path.join(__dirname, 'dist/wfprev'))); // Send all requests to Angular app -app.get('/*', (req, res) => { +app.get('/pub/wfprev/*', (req, res) => { res.sendFile(path.join(__dirname, 'dist/wfprev/index.html')); });