mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2024-12-26 08:41:50 +01:00
add a bit of docs
This commit is contained in:
parent
b626aa66ba
commit
4b273c6bf9
@ -66,7 +66,10 @@ object JavalinSetup {
|
|||||||
|
|
||||||
val app = Javalin.create { config ->
|
val app = Javalin.create { config ->
|
||||||
try {
|
try {
|
||||||
|
// if the bellow line throws an exception then webUI is not bundled
|
||||||
Main::class.java.getResource("/react/index.html")
|
Main::class.java.getResource("/react/index.html")
|
||||||
|
|
||||||
|
// no exception so we can tell javalin to serve webUI
|
||||||
hasWebUiBundled = true
|
hasWebUiBundled = true
|
||||||
config.addStaticFiles("/react")
|
config.addStaticFiles("/react")
|
||||||
config.addSinglePageRoot("/", "/react/index.html")
|
config.addSinglePageRoot("/", "/react/index.html")
|
||||||
@ -77,10 +80,11 @@ object JavalinSetup {
|
|||||||
config.enableCorsForAllOrigins()
|
config.enableCorsForAllOrigins()
|
||||||
}.start(serverConfig.ip, serverConfig.port)
|
}.start(serverConfig.ip, serverConfig.port)
|
||||||
|
|
||||||
|
// when JVM is prompted to shutdown, stop javalin gracefully
|
||||||
Runtime.getRuntime().addShutdownHook(
|
Runtime.getRuntime().addShutdownHook(
|
||||||
thread(start = false) {
|
thread(start = false) {
|
||||||
app.stop()
|
app.stop()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (hasWebUiBundled && serverConfig.initialOpenInBrowserEnabled) {
|
if (hasWebUiBundled && serverConfig.initialOpenInBrowserEnabled) {
|
||||||
|
Loading…
Reference in New Issue
Block a user