tobby
04/05/2017, 8:06 PMtobby
04/05/2017, 8:06 PMtobby
04/05/2017, 8:35 PMcall.respond(FreeMarkerContent("login.ftl"), (""), "" )
tobby
04/05/2017, 8:36 PMtobby
04/05/2017, 8:37 PMorangy
tobby
04/05/2017, 8:55 PMcall.respond(FreeMarkerContent("login.ftl",
mapOf("user" to "Tobby",
"latestProductName" to "OUr thing",
"latestProductUrl" to "<http://google.com>"), ""))
orangy
tobby
04/06/2017, 9:41 PMtobby
04/06/2017, 9:43 PMtobby
04/06/2017, 9:44 PMException in thread "main" java.lang.IllegalStateException: No instance for key AttributeKey: Transformation Support
at org.jetbrains.ktor.util.Attributes.get(Attributes.kt:15
orangy
tobby
04/07/2017, 10:42 AMtobby
04/07/2017, 11:03 AMfun main(args: Array<String>) {
val server = embeddedNettyServer(8080, "127.0.0.1") {
install(ApplicationTransform)
install(FreeMarker) {
templateLoader = ClassTemplateLoader(javaClass.classLoader, "templates")
}
install(Routing) {
get("/") {
call.respondText("Hello world!", ContentType.Text.Html)
}
get("/login") {
call.respond(FreeMarkerContent("login.ftl",
mapOf("user" to "Tobby",
"latestProductName" to "OUr thing",
"latestProductUrl" to "<http://google.com>"), ""))
}
}
}
server.start(wait = true)
}
orangy
tobby
04/07/2017, 11:23 AMorangy
tobby
04/07/2017, 4:04 PMtobby
04/07/2017, 4:04 PMtobby
04/07/2017, 4:05 PMtobby
04/07/2017, 4:06 PMorangy
orangy
orangy
orangy
orangy
0.3.1
and remove install(ApplicationTransform)
orangy
orangy
jmfayard
04/08/2017, 7:23 PMjmfayard
04/08/2017, 7:24 PMLocations
feature when I started to work on this. With this + kotlinx.html I can generate the homge page easily