Skip to content

Commit

Permalink
Allow serving UI from dist/ (#1315)
Browse files Browse the repository at this point in the history
To allow serving UI from the build result in `dist/`, add the same
redirects to than for `webapp/`, so that relative service URLs work
again.

Mitigates issue #1314
  • Loading branch information
chgeo authored Dec 6, 2024
1 parent 86f336a commit 2a0f6f1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,29 @@ npx cds-typer "*"
cds-tsx watch
```

#### Accessing the SAP Fiori Apps

Open these links in your browser:
* http://localhost:4004/sap.fe.cap.travel/index.html for processing the travel data
* http://localhost:4004/sap.fe.cap.travel_analytics/index.html for the [Analytical List Page](https://ui5.sap.com/#/topic/3d33684b08ca4490b26a844b6ce19b83) (ALP)


### Build and Run - Java Backend

In the root folder of your project, run
```
npm ci
npm run build:ui
mvn spring-boot:run
```

### Accessing the SAP Fiori Apps
> At the moment, there is no watch mode for Fiori UI changes. Run `npm run build:ui` after each change there.
#### Accessing the SAP Fiori Apps

Open these links in your browser:
* http://localhost:4004/travel_processor/webapp/index.html for processing the travel data
* http://localhost:4004/travel_analytics/webapp/index.html for the [Analytical List Page](https://ui5.sap.com/#/topic/3d33684b08ca4490b26a844b6ce19b83) (ALP)
* http://localhost:4004/travel_processor/dist/index.html for processing the travel data
* http://localhost:4004/travel_analytics/dist/index.html for the [Analytical List Page](https://ui5.sap.com/#/topic/3d33684b08ca4490b26a844b6ce19b83) (ALP)

Log in with user `amy` and empty password.

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"scripts": {
"lint": "npx eslint .",
"start": "cds-serve",
"build:ui": "npm run build --prefix app/travel_analytics && npm run build --prefix app/travel_processor",
"test": "jest",
"test:mocha": "npx -y mocha",
"travel-processor": "cds-tsx watch --open sap.fe.cap.travel/index.html?sap-ui-xx-viewCache=false",
Expand Down
4 changes: 3 additions & 1 deletion srv/src/main/java/com/sap/cap/sflight/ui/RedirectFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha

String[] uiServicePaths = {
"/travel_processor/webapp/processor",
"/travel_analytics/webapp/analytics"
"/travel_analytics/webapp/analytics",
"/travel_processor/dist/processor",
"/travel_analytics/dist/analytics"
};

String path = req.getRequestURI();
Expand Down

0 comments on commit 2a0f6f1

Please sign in to comment.