mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 03:14:40 -05:00
Start Server after routes are defined (#881)
* Start Server after routes are defined * Separate events
This commit is contained in:
@@ -106,13 +106,15 @@ object JavalinSetup {
|
|||||||
handler.handle(ctx)
|
handler.handle(ctx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.events { event ->
|
}
|
||||||
|
|
||||||
|
app.events { event ->
|
||||||
event.serverStarted {
|
event.serverStarted {
|
||||||
if (serverConfig.initialOpenInBrowserEnabled.value) {
|
if (serverConfig.initialOpenInBrowserEnabled.value) {
|
||||||
Browser.openInBrowser()
|
Browser.openInBrowser()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start()
|
}
|
||||||
|
|
||||||
// when JVM is prompted to shutdown, stop javalin gracefully
|
// when JVM is prompted to shutdown, stop javalin gracefully
|
||||||
Runtime.getRuntime().addShutdownHook(
|
Runtime.getRuntime().addShutdownHook(
|
||||||
@@ -150,6 +152,8 @@ object JavalinSetup {
|
|||||||
GraphQL.defineEndpoints()
|
GraphQL.defineEndpoints()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getOpenApiOptions(): OpenApiOptions {
|
private fun getOpenApiOptions(): OpenApiOptions {
|
||||||
|
|||||||
Reference in New Issue
Block a user