Skip to content

Commit

Permalink
Stub out master branch (use as template repository)
Browse files Browse the repository at this point in the history
Sort Gradle dependencies
Version bump
Crop ktor.png
  • Loading branch information
SebastianAigner committed May 11, 2020
1 parent d2fbe20 commit a27184b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 77 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ dependencies {
implementation "io.ktor:ktor-server-core:$ktor_version"
implementation "io.ktor:ktor-server-netty:$ktor_version"
implementation "io.ktor:ktor-html-builder:$ktor_version"
implementation "ch.qos.logback:logback-classic:$logback_version"
implementation "io.ktor:ktor-freemarker:$ktor_version"
implementation "ch.qos.logback:logback-classic:$logback_version"
}

compileKotlin {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ktor_version=1.3.2
kotlin.code.style=official
kotlin_version=1.3.70
logback_version=1.2.1
kotlin_version=1.3.72
logback_version=1.2.3
41 changes: 4 additions & 37 deletions src/main/kotlin/com/jetbrains/handson/website/Application.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.jetbrains.handson.website

import freemarker.cache.*
import freemarker.core.HTMLOutputFormat
import io.ktor.application.*
import io.ktor.freemarker.*
import io.ktor.html.respondHtml
import io.ktor.http.HttpStatusCode
import io.ktor.http.content.*
import io.ktor.request.receiveParameters
import io.ktor.response.*
import io.ktor.routing.*
import kotlinx.html.*
Expand All @@ -13,41 +16,5 @@ import kotlinx.html.*
fun main(args: Array<String>): Unit = io.ktor.server.netty.EngineMain.main(args)

fun Application.module() {
install(FreeMarker) {
templateLoader = ClassTemplateLoader(this::class.java.classLoader, "templates")
}
routing {
static("/static") {
resources("files")
}
get("/html") {
call.respondHtml {
head {
title {
+"Returning HTML using Kotlinx.HTML"
}
}
body {
h1 {
+"Kotlinx.Html"
}
p {
+"We're using a static HTML DSL"
}
val numbers = 1..10
ul {
numbers.forEach {
li {
value = it.toString()
+"Item $it"
}
}
}
}
}
}
get("/freemarker") {
call.respond(FreeMarkerContent("index.ftl", mapOf("data" to IndexData(listOf(1, 2, 3))), ""))
}
}

}
3 changes: 0 additions & 3 deletions src/main/kotlin/com/jetbrains/handson/website/IndexData.kt

This file was deleted.

17 changes: 0 additions & 17 deletions src/main/resources/files/index.html

This file was deleted.

Binary file modified src/main/resources/files/ktor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 0 additions & 17 deletions src/main/resources/templates/index.ftl

This file was deleted.

0 comments on commit a27184b

Please sign in to comment.