A feature of ktor for setting up single page application like Angular, React and so on
compile("work.jeong.murry.ktor.features:ktor-easy-spa:1.0.1")
<dependency>
<groupId>work.jeong.murry.ktor.features</groupId>
<artifactId>ktor-easy-spa</artifactId>
<version>1.0.1</version>
</dependency>
dependencies {
implementation("work.jeong.murry.ktor.features", "ktor-easy-spa", "1.0.1")
}
Just install the feature in your application with:
install(EasySpaFeature)
or
install(EasySpaFeature) {
staticRootDocs = "./htdocs"
defaultFile = "index.html"
apiUrl = "/api"
}