aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorMarvin Borner2019-04-18 21:44:26 +0200
committerMarvin Borner2019-04-18 21:44:26 +0200
commit8c85eef4dd56b6a2d4a2563c5634dc2c60a35370 (patch)
treeae8ff0614099bff2ced0696932318b90ac1c0960 /src/main
parent663ca2f73d88072f35dc33a6b85a3742a8f62e64 (diff)
Finally fixed building from commandline
Co-authored-by: LarsVomMars <lars@kroenner.eu>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/kotlin/App.kt13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main/kotlin/App.kt b/src/main/kotlin/App.kt
index 37c7f11..3967d80 100644
--- a/src/main/kotlin/App.kt
+++ b/src/main/kotlin/App.kt
@@ -9,6 +9,8 @@ import io.javalin.rendering.*
import io.javalin.rendering.template.TemplateUtil.model
import io.javalin.security.*
import io.javalin.security.SecurityUtil.roles
+import io.javalin.staticfiles.*
+import java.io.*
import java.util.logging.*
const val fileHome = "files"
@@ -18,10 +20,13 @@ val fileController = FileController()
val log = Logger.getLogger("App.kt")
fun main() {
- val app = Javalin.create()
- .enableStaticFiles("../resources/")
- .accessManager { handler, ctx, permittedRoles -> roleManager(handler, ctx, permittedRoles) }
- .start(7000)
+ log.warning(File(".").absolutePath)
+
+ val app = Javalin.create().apply {
+ enableStaticFiles("${File(".").absolutePath}/src/main/resources/", Location.EXTERNAL)
+ port(7000)
+ accessManager { handler, ctx, permittedRoles -> roleManager(handler, ctx, permittedRoles) }
+ }.start()
// Set up templating
RockerRuntime.getInstance().isReloading = false