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

}

}

@cask.get("/")

defhello= {

html(

head(

link(

rel := "stylesheet",

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

),

(raw("""

function submitForm{

fetch(

"/",

{

method: "POST",

body: JSON.stringify({name: nameInput.value, msg: msgInput.value})

}

).then(response => response.json)

推荐阅读