I want to migrate my application to Spring Boot Jar Deployment. It currently uses Spring 4 without Boot.
I have a REST-API listening at /api/*
and a Javascript-Frontend at src/main/webapp
which can be accessed at /*
.
Now i don't find a way doing the same in Boot.
I managed to get my api listening at /api/*
by changing the server.context-path
property but I didn't manage to register a second servlet to serve my js-frontend at /*
. I know that src/main/webapp
is not supported by a jar deployment and i also know that Spring Boot serves static files from src/resources/public
and src/resources/static
. But in my case these folder then also points to /api/*
because of the server.context-path
change.
I tried is to register another servlet as a bean. This destroyed my api-endpoint.
What would be the best way to achieve this?