Skip to content

There is no index.html in distributions folder #27

@HaitianZhuu

Description

@HaitianZhuu

In the tutorial and codebase, previously index.html file is in the src/commonMain/resources folder.
But now with new project structure in IDEA, when we select project template as Full-Stack Web Application, we don't have index.html in src/commonMain/resources folder explicitly, instead we have such code in jvmMain/kotlin/Server.kt:

fun HTML.index() {
    head {
        title("Hello from Ktor!")
    }
    body {
        div {
            id = "root"
        }
        script(src = "/static/MyFullStackWeb.js") {}
    }
}
routing {
        get("/") {
            call.respondHtml(HttpStatusCode.OK, HTML::index)
        }
        static("/static") {
            resources()
        }
}

After ./gradlew build, we don't see *.html under /build/distributions folder, only
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions