daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Dec 7th, 2018 62 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. package it.my.demo;
  2.  
  3. import org.springframework.boot.SpringApplication;
  4. import org.springframework.boot.autoconfigure.SpringBootApplication;
  5. import org.springframework.boot.builder.SpringApplicationBuilder;
  6. import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
  7. import org.springframework.context.annotation.Bean;
  8.  
  9. import springfox.documentation.builders.PathSelectors;
  10. import springfox.documentation.builders.RequestHandlerSelectors;
  11. import springfox.documentation.spi.DocumentationType;
  12. import springfox.documentation.spring.web.plugins.Docket;
  13. import springfox.documentation.swagger2.annotations.EnableSwagger2;
  14.  
  15. @SpringBootApplication
  16. @EnableSwagger2
  17. public class MongoTesterApplication extends SpringBootServletInitializer {
  18.  
  19.   public static void main(String[] args) {
  20.     SpringApplication.run(MongoTesterApplication.class, args);
  21.   }
  22.  
  23.   @Override
  24.   protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
  25.     return application
  26.         .sources(MongoTesterApplication.class)
  27.         .properties("spring.config.location:" + System.getProperty("jboss.home.dir") + "/var/");
  28.   }
  29.  
  30.   @Bean
  31.   public Docket apiDocket() {
  32.     return new Docket(DocumentationType.SWAGGER_2)
  33.         .select()
  34.         .apis(RequestHandlerSelectors.any())
  35.         .paths(PathSelectors.any())
  36.         .build();
  37.   }
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top