I have been working on Spring Boot Rest API using MongoDB with embedded Tomcat for about a month now to build a REST API. Everything was working fine. I now want to deploy the API in a separate development environment so that anybody can access the API.
I followed the step mentioned at http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file
- Change the packaging to war
- Added this to my pom.xml provided for spring-boot-starter-tomcat
- extends my application to SpringBootServletInitializer and overwrote the configure method.
- my application.properties has this:
spring.data.rest.base-path=/
After doing all these: I tried accessing the URL localhost:8080/my-war-name/employees it gives me 404 error but if I run the same application as standalone like via main() or run as Spring Boot. I can access my API at localhost:8080/employees
Am I missing something? Any help would be appreciated.