Refactor build and server setup
Introduced a versioning task in a new `version.gradle.kts` file to auto-generate version properties. The main server setup in `Main.kt` was refactored to streamline server initialization using `UndertowServer`. Dependencies and configurations in `build.gradle.kts` were updated to deploy effectively, including improved yarn lock handling and symbolic link integration.
This commit is contained in:
@@ -1,15 +1,9 @@
|
||||
package nl.astraeus.vst.chip
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig
|
||||
import io.undertow.Undertow
|
||||
import io.undertow.UndertowOptions
|
||||
import io.undertow.server.session.InMemorySessionManager
|
||||
import io.undertow.server.session.SessionAttachmentHandler
|
||||
import io.undertow.server.session.SessionCookieConfig
|
||||
import nl.astraeus.vst.chip.db.Database
|
||||
import nl.astraeus.vst.base.Settings
|
||||
import nl.astraeus.vst.base.web.UndertowServer
|
||||
import nl.astraeus.vst.chip.logger.LogLevel
|
||||
import nl.astraeus.vst.chip.logger.Logger
|
||||
import nl.astraeus.vst.chip.web.RequestHandler
|
||||
|
||||
fun main() {
|
||||
Logger.level = LogLevel.DEBUG
|
||||
@@ -18,32 +12,44 @@ fun main() {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
Class.forName("nl.astraeus.jdbc.Driver")
|
||||
Settings.port = 9005
|
||||
Settings.jdbcStatsPort = 6005
|
||||
|
||||
Database.initialize(HikariConfig().apply {
|
||||
driverClassName = "nl.astraeus.jdbc.Driver"
|
||||
jdbcUrl = "jdbc:stat:webServerPort=6002:jdbc:sqlite:data/chip.db"
|
||||
username = "sa"
|
||||
password = ""
|
||||
maximumPoolSize = 25
|
||||
isAutoCommit = false
|
||||
/*
|
||||
Class.forName("nl.astraeus.jdbc.Driver")
|
||||
|
||||
validate()
|
||||
})
|
||||
Database.initialize(HikariConfig().apply {
|
||||
driverClassName = "nl.astraeus.jdbc.Driver"
|
||||
jdbcUrl = "jdbc:stat:webServerPort=6002:jdbc:sqlite:data/chip.db"
|
||||
username = "sa"
|
||||
password = ""
|
||||
maximumPoolSize = 25
|
||||
isAutoCommit = false
|
||||
|
||||
val sessionHandler = SessionAttachmentHandler(
|
||||
InMemorySessionManager("vst-session-manager"),
|
||||
SessionCookieConfig()
|
||||
validate()
|
||||
})
|
||||
|
||||
val sessionHandler = SessionAttachmentHandler(
|
||||
InMemorySessionManager("vst-session-manager"),
|
||||
SessionCookieConfig()
|
||||
)
|
||||
sessionHandler.setNext(RequestHandler)
|
||||
|
||||
val server = Undertow.builder()
|
||||
.addHttpListener(Settings.port, "localhost")
|
||||
.setIoThreads(4)
|
||||
.setHandler(sessionHandler)
|
||||
.setServerOption(UndertowOptions.SHUTDOWN_TIMEOUT, 1000)
|
||||
.build()
|
||||
|
||||
println("Starting server at port ${Settings.port}...")
|
||||
server?.start()
|
||||
*/
|
||||
|
||||
|
||||
|
||||
UndertowServer.start(
|
||||
"Vst Chip",
|
||||
"/vst-chip-worklet-ui.js"
|
||||
)
|
||||
sessionHandler.setNext(RequestHandler)
|
||||
|
||||
val server = Undertow.builder()
|
||||
.addHttpListener(Settings.port, "localhost")
|
||||
.setIoThreads(4)
|
||||
.setHandler(sessionHandler)
|
||||
.setServerOption(UndertowOptions.SHUTDOWN_TIMEOUT, 1000)
|
||||
.build()
|
||||
|
||||
println("Starting server at port ${Settings.port}...")
|
||||
server?.start()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user