2

I have a multi-client application using Angular 5 for the front end and a Java REST based backend. The development has been done using the ng server. For production I want to provide an industry accepted server. My choice was Tomcat 9.0. I have configured the application to be located in

/webapps/ui/

I have configured the WEB-INF/web.xml as

<web-app>
    <error-page>
        <error-code>404</error-code>
        <location>/ui/index.html</location>
    </error-page>
</web-app>

I have chosen the Hash Location Strategy options since I have been unable to get the Path Location Strategy to work. I would prefer the Path Location Strategy but I'm at the point I'd just like it to work.

When a user goes to

/ui/

they will simply go to a non-working login page.

The first page the user should go to is

/ui/#/calendar/123

This does not work but should display a calendar with availability of dates depending on what is returned from the REST call. Instead it will show the non-working log in page.

I had configured the app-routing.module.ts with

RouterModule.forRoot(routes, {useHash: true})

I built it with

ng build --base-href /ui --deploy-url /ui

I had copied the contents of dist into the /webapps/ui folder.

I am trying to find a good resource for either strategy where I can go to the route and have it display the same results as when testing using ng.

4

0 回答 0