Java Spring-boot: Problem to finde resources

Viewed 55

I have a Spring-boot backend Angular front end application. The application runs well if it is run on port 4200 (Running frontend from the front end). But I have done the integration an I run in to troubles. The application after the following commands:

mvn clean install
npm install
npm build

Properly generate the dist folder on the front end and copy them in the source folder (project/src/main/resources/static). When I try to run the application from the back end (definded port 8999) the application finde the index.html file in static folder but cannot find the other scripts. The application start looking for those resources on localhost:8999/resourcefile instead of looking for it in localhost:8999/src/main/resources/static

Do anyone have any idea?

1 Answers

For anyone with the same problem. There was declared <base href="/"> in my index.html and that's why it was looking for resources from the wrong directory.

Related