I am trying to serve a compose multiplatform appli...
# ktor
h
I am trying to serve a compose multiplatform application via Ktor using the
singlePageApplication
plugin:
Copy code
routing {
            singlePageApplication {
                applicationRoute = "/admin"
                filesPath = DirectoryManager.spaDir.absolutePath
            }
    }
In my index.html I then link to scripts like so:
Copy code
<script src="/admin/skiko.js"></script>
A problem I am having is that files placed in the resources folder is not served on the
/admin
endpoint but on the root eg:
<http://mydomain.com/composeResources/app.generated.resources/files/config.yaml>
How do I fix this so that
composeResources
are also on the admin path?
I have found a solution:
Copy code
singlePageApplication {
                applicationRoute = "/admin"
                useResources = true
                filesPath = "spa"
            }
I add
Copy code
<base href="/admin/">
to my head tag in my index.html I then place my built files in
commonMain/resources/spa
👍 1