From d391ce632be29c49a612c64eb5f720238a46844d Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Fri, 17 Jan 2025 16:15:56 +0100 Subject: feat(server): Add all in one http server --- server/aio/build.gradle.kts | 19 +++++++++++++++++++ .../src/main/kotlin/moe/nea/ledger/server/aio/AIO.kt | 20 ++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 server/aio/build.gradle.kts create mode 100644 server/aio/src/main/kotlin/moe/nea/ledger/server/aio/AIO.kt (limited to 'server/aio') diff --git a/server/aio/build.gradle.kts b/server/aio/build.gradle.kts new file mode 100644 index 0000000..22819f0 --- /dev/null +++ b/server/aio/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + kotlin("jvm") + application +} + +dependencies { + declareKtorVersion() + implementation(project(":server:core")) + implementation(project(":server:frontend")) +} + +java { + toolchain.languageVersion.set(JavaLanguageVersion.of(21)) +} + +application { + mainClass.set("moe.nea.ledger.server.core.ApplicationKt") +} + diff --git a/server/aio/src/main/kotlin/moe/nea/ledger/server/aio/AIO.kt b/server/aio/src/main/kotlin/moe/nea/ledger/server/aio/AIO.kt new file mode 100644 index 0000000..e59301f --- /dev/null +++ b/server/aio/src/main/kotlin/moe/nea/ledger/server/aio/AIO.kt @@ -0,0 +1,20 @@ +package moe.nea.ledger.server.aio + +import io.ktor.server.application.Application +import io.ktor.server.http.content.singlePageApplication +import io.ktor.server.routing.Routing +import moe.nea.ledger.server.core.AIOProvider + + +class AIO : AIOProvider { + override fun Routing.installExtraRouting() { + singlePageApplication { + useResources = true + filesPath = "ledger-web-dist" + defaultPage = "index.html" + } + } + + override fun Application.module() { + } +} \ No newline at end of file -- cgit