0

For me very basic navigation is not working with newly generated jHipster app.

I have 2 html pages in the root: index.html and network.html

Here is how I would like to redirect to network.html:

                             <a href="/network.html">
                                <button type="submit"
                                        class="btn btn-info btn-sm">
                                    <fa-icon icon="project-diagram"></fa-icon>
                                    <span class="d-none d-md-inline">Network</span>
                                </button>
                            </a>

Unfortunately this doesn't work and I get 404 Not Found.

Can you please advise how to make external navigation working with JHipster? I have tried all examples from How to redirect to an external URL from angular2 route without using component? and nothing works

tillias
  • 1,035
  • 2
  • 12
  • 30

1 Answers1

1

You have to modify src/main/java/{your-package}/config/WebConfigurer.java and add a resource handler for your static file. By default, all routes are redirected to index.html, which is how most SPA applications work.

Matt Raible
  • 8,187
  • 9
  • 61
  • 120
  • Thanks, is there any additional information available? Maybe you can provide some example how to serve network.html in addition to index.html so I can mark it as answer? – tillias Apr 30 '20 at 09:56
  • More to have a lookup option for myself I tried to understand and write down what is going on when routing in an Angular SPA the JHipster-generated way (which means best practice) here: https://stackoverflow.com/a/60178766/7773582 - but the angular component based style, not static. Maybe that may help you? – Jochen Haßfurter May 08 '20 at 00:08