
As a follow up on my experience with custom domains, I started applying more custom domains to my applications running on BTP. Feel free to read more about the setup of a custom domain here: https://community.sap.com/t5/technology-blogs-by-members/custom-domains-for-btp-cloudfoundry-applica...
One of these applications is a CAP application with a UI5 app on top of it and an approuter to access it, the app is published on my GitHub account here: https://github.com/lemaiwo/ReCAPBTPServiceOverview/tree/main
After applying my custom domain to this particular application the approuter added a path behind the url. When I navigated to: https://btp-services.lemaire.tech/ (where “lemaire.tech” is the custom domain with “btp-services” as hostname),
It forwarded me to: https://btp-services.lemaire.tech/recapcapadvancedprogrammingmodelbtpservices/index.html
Most of the configuration behind this, was provided by the generators in BAS. In the xs-app.json of the UI5 app the following config was provided:
In the approuter there were no mappings but it did had a welcomeFile:
https://github.com/lemaiwo/ReCAPBTPServiceOverview/blob/main/approuter/xs-app.json
Because of this config, the approuter automatically adds the path of the welcomeFile to the url:
This path is based on the name of the application and it is needed for the approuter to forward the user to the right application. In this specific example, I only have one html5 app so that’s why it’s put in the welcomeFile. How this path is generated and accessible by the approuter is very well explaned in this blog post:
https://community.sap.com/t5/technology-blogs-by-sap/sap-application-router/ba-p/13393550
Especially the part for html5 app integration is important:
Integration with HTML5 App Repo service:
{ "source": "^(/.*)", "target": "$1", "service": "html5-apps-repo-rt", "authenticationType": "xsuaa" }
appVersion (application version) - Optional
resourcePath (path to file)
For more details please refer to the following Blog: |
More details in this one: https://community.sap.com/t5/technology-blogs-by-sap/fiori-application-programming-model-for-cloud-f...
As a solution to have a clean url to the application, I applied the following changes to the xs-app.json of the approuter:
https://github.com/lemaiwo/ReCAPBTPServiceOverview/blob/main/approuter/xs-app.json
Make sure the html5 app repository runtime and destination service are bound to the approuter:
In case it is not done yet, add the route in the mta.yaml config:
A clean url with a forward that changes the path: https://btp-services.lemaire.tech/index.html
Full repo: https://github.com/lemaiwo/ReCAPBTPServiceOverview/tree/main
Sidenote: some of the screenshots may still contain a different domain. I recently changed the domain from Wouter.lemaire.tech to Lemaire.tech.
Kr, Wouter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 |