From 42829771426615536117e296c24b275f2b810532 Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 5 Nov 2023 17:03:07 -0800 Subject: [PATCH] Expose the resource path for accessing static assets --- .../com/vandenbreemen/ktt/interactor/StaticContentInteractor.kt | 1 + src/main/kotlin/com/vandenbreemen/ktt/web/MainServer.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/vandenbreemen/ktt/interactor/StaticContentInteractor.kt b/src/main/kotlin/com/vandenbreemen/ktt/interactor/StaticContentInteractor.kt index 84dbe4a..f3ad091 100644 --- a/src/main/kotlin/com/vandenbreemen/ktt/interactor/StaticContentInteractor.kt +++ b/src/main/kotlin/com/vandenbreemen/ktt/interactor/StaticContentInteractor.kt @@ -11,6 +11,7 @@ class StaticContentInteractor { * Directory name. Will be relative to the running instance */ val staticContentRoot = "kttStatic" + val staticContentWebPath = "/res" /** * Set up the static content directory diff --git a/src/main/kotlin/com/vandenbreemen/ktt/web/MainServer.kt b/src/main/kotlin/com/vandenbreemen/ktt/web/MainServer.kt index a9797c3..a89e81e 100644 --- a/src/main/kotlin/com/vandenbreemen/ktt/web/MainServer.kt +++ b/src/main/kotlin/com/vandenbreemen/ktt/web/MainServer.kt @@ -63,7 +63,7 @@ fun startServer(staticContentInteractor: StaticContentInteractor, configInteract private fun Routing.setupStaticContent(staticContentInteractor: StaticContentInteractor) { staticContentInteractor.setupDirectory() - staticFiles("/res", File(staticContentInteractor.staticContentRoot)) + staticFiles(staticContentInteractor.staticContentWebPath, File(staticContentInteractor.staticContentRoot)) } private fun Routing.customCssTooling(presenter: WikiPresenter) {