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

else{

messages = messages :+ (name -> msg)

hello(None, Some(name), None)

}

}

@cask.get("/")

def hello(errorOpt: Option[String] = None,

userName: Option[String] = None,

msg: Option[String] = None) = {

html(

head(

link(

rel := "stylesheet",

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

)

),

body(

div(cls := "container")(

推荐阅读