1
0
Fork 0

Fix to run jar from command line

main
Kevin Belisle 2021-07-06 17:23:47 -04:00
parent ca3a8d6186
commit ca1cd8b8ac
2 changed files with 8 additions and 3 deletions

View File

@ -72,6 +72,12 @@ tasks.register<Copy>("copySinglePageApp") {
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 {
// Define the main class for the application.
mainClass.set("xyz.etztech.stonks.AppKt")

View File

@ -24,9 +24,8 @@ fun initApiServer(apiServerPort: Int, database: Database) {
val app =
Javalin.create { config ->
config.enableCorsForAllOrigins()
config.addStaticFiles("./spa")
config.addStaticFiles("/")
config.addSinglePageRoot("/", "./spa")
config.addStaticFiles("spa")
config.addSinglePageRoot("/", "spa")
config.enforceSsl = false
config.ignoreTrailingSlashes = true
}