examples/vweb: use map instead of string in call to app.json (#12338)
parent
81b95ece51
commit
ce9f26c589
|
@ -26,7 +26,9 @@ fn main() {
|
|||
['/users/:user']
|
||||
pub fn (mut app App) user_endpoint(user string) vweb.Result {
|
||||
id := rand.intn(100)
|
||||
return app.json('{"$user": $id}')
|
||||
return app.json({
|
||||
user: id
|
||||
})
|
||||
}
|
||||
|
||||
pub fn (mut app App) index() vweb.Result {
|
||||
|
|
Loading…
Reference in New Issue