Skip to content

Commit

Permalink
Integrate Ktor example tests into Kotlin Web Examples doc page (#3668)
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi authored Oct 5, 2024
1 parent d0cc6f8 commit 98487db
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* xref:kotlinlib/linting.adoc[]
* xref:kotlinlib/publishing.adoc[]
* xref:kotlinlib/build-examples.adoc[]
* xref:kotlinlib/web-examples.adoc[]
.Build Tool Comparisons
* xref:comparisons/maven.adoc[]
Expand Down
18 changes: 18 additions & 0 deletions docs/modules/ROOT/pages/kotlinlib/web-examples.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
= Kotlin Web Examples

++++
<script>
gtag('config', 'AW-16649289906');
</script>
++++

This page contains examples of using Mill as a build tool for web-applications.
It covers setting up a basic backend server with a variety of server frameworks

== Ktor Hello World App

include::partial$example/kotlinlib/web/1-hello-ktor.adoc[]
== Ktor TodoMvc App

include::partial$example/kotlinlib/web/2-todo-ktor.adoc[]

8 changes: 7 additions & 1 deletion example/kotlinlib/web/1-hello-ktor/build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ object `package` extends RootModule with KotlinModule {
}
}

/** See Also: src/com/example/HelloKtor.kt */
/** See Also: test/src/com/example/HelloKtorTest.kt */

// This example demonstrates how to set up a simple webserver
// serving a single "<h1>Hello, World!</h1>" web page using Kotlin and Ktor
// serving a single "<h1>Hello, World!</h1>" web page using Kotlin and Ktor.
// It includes one module which is the Ktor webserver/app, and one test module
// using kotest

/** Usage

> mill test
Test com.example.HelloKtorTest finished, took...

> mill runBackground

Expand Down

0 comments on commit 98487db

Please sign in to comment.