Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no index.html in distributions folder #27

Open
HaitianZhuu opened this issue May 10, 2023 · 0 comments
Open

There is no index.html in distributions folder #27

HaitianZhuu opened this issue May 10, 2023 · 0 comments

Comments

@HaitianZhuu
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant