0

I created an spring boot project with angular-cli. The output jar file looks like below:

BOOT-INF
    |- classes
        |- com
        |- static
            |- index.html

Now, when I go to the following url

http://<ip>:<port>

I got redirected to http://<ip>:<port>/app1 since in my angular route, I configured it to redirect.

But when I try to refresh http://<ip>:<port>/app1, I got 404 not found.

iPhoneJavaDev
  • 821
  • 5
  • 33
  • 78

1 Answers1

-1

Spring Boot automatically detects index.html in the following location public/static/webapp.

If you have any controller specifically written a mapping as like this -> @Requestmapping("/") it will override the default behavior and it will not show the index.html unless you route to http:\\localhost:8080\index.html

You might want to create it under this folder structure

src/main/resources/public/index.html

Hope this helps!

N00b Pr0grammer
  • 4,503
  • 5
  • 32
  • 46