Skip to content

Commit 07bf976

Browse files
authored
Update multiplatform-full-stack-app.md during the version updates (#3764)
It depends on those changes kotlin-hands-on/jvm-js-fullstack#33
1 parent aecc8b9 commit 07bf976

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

docs/topics/multiplatform/multiplatform-full-stack-app.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ Whenever you run the server with the `run` Gradle task, the frontend is also bui
405405
artifacts. To learn more about how this works, see the [Relevant Gradle configuration](#relevant-gradle-configuration-for-the-frontend)
406406
section.
407407

408-
The template already comes with a boilerplate `index.html` file in the `src/commonMain/resources` folder. It has
408+
The template already comes with a boilerplate `index.html` file in the `src/commonMain/resources/static` folder. It has
409409
a `root` node for rendering components and a `script` tag that includes the application:
410410

411411
```xml
@@ -448,8 +448,9 @@ tasks.getByName<Jar>("jvmJar") {
448448
"jsBrowserDevelopmentWebpack"
449449
}
450450
val webpackTask = tasks.getByName<KotlinWebpack>(taskName)
451-
dependsOn(webpackTask) // make sure JS gets compiled first
452-
from(File(webpackTask.destinationDirectory, webpackTask.outputFileName)) // bring output file along into the JAR
451+
dependsOn(webpackTask)
452+
from(webpackTask.map { it.mainOutputFile.get().asFile }) // bring output file along into the JAR
453+
into("static")
453454
}
454455
```
455456

@@ -474,12 +475,6 @@ root directory.
474475
1. In `src/jvmMain/kotlin/Server.kt`, add the corresponding routes to the `routing` block:
475476

476477
```kotlin
477-
get("/") {
478-
call.respondText(
479-
this::class.java.classLoader.getResource("index.html")!!.readText(),
480-
ContentType.Text.Html
481-
)
482-
}
483478
staticResources("/", "static")
484479
route(ShoppingListItem.path) {
485480
// ...

0 commit comments

Comments
 (0)