用Scala实现简单的Web和API服务器(11)

packageapp

importscalatags.Text.all._

object MinimalApplication extends cask.MainRoutes{

@cask.get("/")

def hello = {

html(

head(

link(

rel := "stylesheet",

href := "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"

)

),

body(

div(cls := "container")(

h1("Scala Chat!"),

hr,

div(

p(b("alice"), " ", "Hello World!"),

推荐阅读