/FileExtraction/Java_unseen/asarkar_spring/hello-world/src/main/java/name/abhijitsarkar/javaee/hello/HelloWorldApp.java
package name.abhijitsarkar.javaee.hello;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;

import javax.sql.DataSource;

/**
 * @author Abhijit Sarkar
 */
@SpringBootApplication
public class HelloWorldApp extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(HelloWorldApp.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(HelloWorldApp.class, args);
    }

    @Bean
    @ConfigurationProperties(prefix = "spring.datasource")
    public DataSource dataSource() {
        return DataSourceBuilder.create().build();
    }
}
