feat(14): initial static section change

paper control switches "controls" to "showdown" - the fragment of
results page. yay
This commit is contained in:
efim
2023-07-01 13:05:55 +00:00
parent 726cadec19
commit 91c53429e0
4 changed files with 22 additions and 1 deletions

View File

@@ -5,6 +5,9 @@ import cask.main.Routes
import org.thymeleaf.context.Context
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver
import org.thymeleaf.TemplateEngine
import org.thymeleaf.Thymeleaf
import scala.jdk.CollectionConverters._
object Main {
@main def run(
@@ -56,11 +59,22 @@ object Main {
)
}
@cask.get("/select/:choice")
def acceptPlayerVote(choice: String) = {
val context = new Context()
val result = templateEngine.process("showdown", Set("showdown-table").asJava, context)
cask.Response(
result,
headers = Seq("Content-Type" -> "text/html;charset=UTF-8")
)
}
@cask.staticResources("/public")
def publicFiles(req: cask.Request) = {
println(s"getting request for ${req.remainingPathSegments}")
"public"
}
initialize()
}