Fix to run jar from command line
parent
ca3a8d6186
commit
ca1cd8b8ac
|
@ -72,6 +72,12 @@ tasks.register<Copy>("copySinglePageApp") {
|
||||||
into(layout.buildDirectory.dir("resources/main/spa"))
|
into(layout.buildDirectory.dir("resources/main/spa"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType<Jar> {
|
||||||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
manifest { attributes["Main-Class"] = "xyz.etztech.stonks.AppKt" }
|
||||||
|
configurations["compileClasspath"].forEach { file: File -> from(zipTree(file.absoluteFile)) }
|
||||||
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
// Define the main class for the application.
|
// Define the main class for the application.
|
||||||
mainClass.set("xyz.etztech.stonks.AppKt")
|
mainClass.set("xyz.etztech.stonks.AppKt")
|
||||||
|
|
|
@ -24,9 +24,8 @@ fun initApiServer(apiServerPort: Int, database: Database) {
|
||||||
val app =
|
val app =
|
||||||
Javalin.create { config ->
|
Javalin.create { config ->
|
||||||
config.enableCorsForAllOrigins()
|
config.enableCorsForAllOrigins()
|
||||||
config.addStaticFiles("./spa")
|
config.addStaticFiles("spa")
|
||||||
config.addStaticFiles("/")
|
config.addSinglePageRoot("/", "spa")
|
||||||
config.addSinglePageRoot("/", "./spa")
|
|
||||||
config.enforceSsl = false
|
config.enforceSsl = false
|
||||||
config.ignoreTrailingSlashes = true
|
config.ignoreTrailingSlashes = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue