cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

HTML5 Application Repository - Client Side Routing problems

daniel_endres
Explorer
729

In my scenario, I have a ReactJS Application hosted in the HTML5 App Repository on CF.

The App internally uses the BrowserRouter from ReactRouter to handle client side Routing.

The direct start of the app works and redirects successfully to the index.html and also the navigation within the App is working fine.

However if I want to Refresh the page or enter the Routing Part directly via the URL the HTML5 App Repo return a "File not found".

<url>.hana.ondemand.com/<repocloudservice>.<sap.app.id>-1.1.0/ --> works and redirected to index.html

<url>.hana.ondemand.com/<repocloudservice>.<sap.app.id>-1.1.0/test --> 404

How can I teach the App Router of the HTML5 Apps Repo to forward all subpaths to the App?

{ 
  "welcomeFile": "/index.html", 
  "authenticationMethod": "route",
  "logout": { 
    "logoutEndpoint": "/do/logout" 
  }, 
  "routes": [ 
   { 
     "authenticationType": "none", 
     "csrfProtection": false, 
     "source": "^/Northwind/(.*)$", 
     "destination": "Northwind", "target": "$1"
   }, 
   { 
     "source": "^(.*)$", 
     "target": "$1", 
     "service": "html5-apps-repo-rt", 
     "authenticationType": "xsuaa" 
   } 
  ]
}

Accepted Solutions (0)

Answers (0)