forked from Minecraft/Stonks
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"))
|
||||
}
|
||||
|
||||
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")
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue