-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
47 additions
and
29 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
material/conferences/2024-02-laug-meetup/kmp-wizard-server-ktor/server/bin/main/Constants.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const val SERVER_PORT = 8080 |
7 changes: 7 additions & 0 deletions
7
material/conferences/2024-02-laug-meetup/kmp-wizard-server-ktor/server/bin/main/Greeting.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class Greeting { | ||
private val platform = getPlatform() | ||
|
||
fun greet(): String { | ||
return "Hello, ${platform.name}!" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
material/conferences/2024-02-laug-meetup/kmp-wizard-server-ktor/server/bin/main/Platform.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class JVMPlatform { | ||
val name: String = "Java ${System.getProperty("java.version")}" | ||
} | ||
|
||
fun getPlatform() = JVMPlatform() |
12 changes: 12 additions & 0 deletions
12
material/conferences/2024-02-laug-meetup/kmp-wizard-server-ktor/server/bin/main/logback.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<configuration> | ||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
<root level="trace"> | ||
<appender-ref ref="STDOUT"/> | ||
</root> | ||
<logger name="org.eclipse.jetty" level="INFO"/> | ||
<logger name="io.netty" level="INFO"/> | ||
</configuration> |
22 changes: 22 additions & 0 deletions
22
...-02-laug-meetup/kmp-wizard-server-ktor/server/bin/main/org/example/project/Application.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.example.project | ||
|
||
import Greeting | ||
import SERVER_PORT | ||
import io.ktor.server.application.* | ||
import io.ktor.server.engine.* | ||
import io.ktor.server.netty.* | ||
import io.ktor.server.response.* | ||
import io.ktor.server.routing.* | ||
|
||
fun main() { | ||
embeddedServer(Netty, port = SERVER_PORT, host = "0.0.0.0", module = Application::module) | ||
.start(wait = true) | ||
} | ||
|
||
fun Application.module() { | ||
routing { | ||
get("/") { | ||
call.respondText("Ktor: ${Greeting().greet()}") | ||
} | ||
} | ||
} |
19 changes: 0 additions & 19 deletions
19
...erences/2024-02-laug-meetup/kotlin2-experimental/app/bin/main/kotlin2/experimental/App.kt
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
...ces/2024-02-laug-meetup/kotlin2-experimental/app/bin/test/kotlin2/experimental/AppTest.kt
This file was deleted.
Oops, something went wrong.