aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-03-16 13:04:11 +0300
committerGravatar Vitaly Takmazov2018-03-16 13:04:11 +0300
commit9f1ced0e55039eecb97932871011d9a97cd97f30 (patch)
tree7c2d3e37507be4430adb466bd10b7d9e2b7a1b04
parentd80a40231eb2e76de761bae9a1c13dca555742e0 (diff)
boot: add servlet initializers
-rw-r--r--juick-server/src/main/java/com/juick/server/ApiServer.java9
-rw-r--r--juick-www/src/main/java/com/juick/www/Application.java9
2 files changed, 16 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/server/ApiServer.java b/juick-server/src/main/java/com/juick/server/ApiServer.java
index b2caff40..bfd5e1ff 100644
--- a/juick-server/src/main/java/com/juick/server/ApiServer.java
+++ b/juick-server/src/main/java/com/juick/server/ApiServer.java
@@ -2,9 +2,16 @@ package com.juick.server;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@SpringBootApplication
-public class ApiServer {
+public class ApiServer extends SpringBootServletInitializer {
+
+ @Override
+ protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
+ return builder.sources(ApiServer.class);
+ }
public static void main(String[] args) {
SpringApplication.run(ApiServer.class, args);
diff --git a/juick-www/src/main/java/com/juick/www/Application.java b/juick-www/src/main/java/com/juick/www/Application.java
index 0e60e1d8..ef41199a 100644
--- a/juick-www/src/main/java/com/juick/www/Application.java
+++ b/juick-www/src/main/java/com/juick/www/Application.java
@@ -2,9 +2,16 @@ package com.juick.www;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@SpringBootApplication
-public class Application {
+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);