Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit05f4117

Browse files
committed
Return Undertow server when calling SimpleServer.start()
1 parentd2a8225 commit05f4117

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎stubbornjava-common/src/main/java/com/stubbornjava/common/undertow/SimpleServer.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public Undertow.Builder getUndertow() {
2626
returnundertowBuilder;
2727
}
2828

29-
publicvoidstart() {
29+
publicUndertowstart() {
3030
Undertowundertow =undertowBuilder.build();
3131
undertow.start();
3232
/*
@@ -37,6 +37,7 @@ public void start() {
3737
undertow.getListenerInfo()
3838
.stream()
3939
.forEach(listenerInfo ->logger.info(listenerInfo.toString()));
40+
returnundertow;
4041
}
4142

4243
publicstaticSimpleServersimpleServer(HttpHandlerhandler) {

‎stubbornjava-webapp/src/main/java/com/stubbornjava/webapp/StubbornJavaWebApp.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
importcom.stubbornjava.webapp.post.PostRoutes;
2020
importcom.stubbornjava.webapp.themes.ThemeRoutes;
2121

22+
importio.undertow.Undertow;
2223
importio.undertow.server.HttpHandler;
2324
importio.undertow.server.RoutingHandler;
2425
importio.undertow.server.handlers.BlockingHandler;
@@ -90,11 +91,11 @@ private static final HttpHandler getBasicRoutes() {
9091
.setFallbackHandler(timed("notFound",PageRoutes::notFound));
9192
}
9293

93-
privatestaticvoidstartServer() {
94+
privatestaticUndertowstartServer() {
9495
HttpHandlerstaticRoutes =newPathHandler(getBasicRoutes())
9596
.addPrefixPath("/assets",timed("getAssets",CustomHandlers.resource("", (int)TimeUnit.DAYS.toSeconds(30))));
9697
SimpleServerserver =SimpleServer.simpleServer(wrapWithMiddleware(staticRoutes));
97-
server.start();
98+
returnserver.start();
9899
}
99100

100101
publicstaticvoidmain(String[]args) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp