I recently finished a simple spring boot application using the INTELLIJ IDE. Applications run locally as a spring application, as well as in Tomcat.
For my next step, I would like to be able to host the application online, but every attempt I made does not seem to work, does not even run on Xampp Tomcat.
Here is my hierarchy:
- CSI
- ---- Java
- --------- com.jcode
- --------------- TestController.java
- --------------- Application.java
- ---- resources
- --------- application.properties
application.properties:
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://xxx.xxx.xxx.xxx:3306/db_digitrainer
spring.datasource.username=test
spring.datasource.password=test
server.context-path=/digitrainer
management.context-path=/manage
Application.java:
@SpringBootApplication
@Configuration
@EnableAutoConfiguration
@EnableWebMvc
@ComponentScan
public class Application extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(Application.class);
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
I was not able to find clear information on how to do this, so I would like to know that I am doing something wrong, and also if spring boot is an approach for developing an API for rest.