Skip to content

Commit ce9f26c

Browse files
authored
examples/vweb: use map instead of string in call to app.json (#12338)
1 parent 81b95ec commit ce9f26c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/vweb/vweb_example.v

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ fn main() {
2626
['/users/:user']
2727
pub fn (mut app App) user_endpoint(user string) vweb.Result {
2828
id := rand.intn(100)
29-
return app.json('{"$user": $id}')
29+
return app.json({
30+
user: id
31+
})
3032
}
3133

3234
pub fn (mut app App) index() vweb.Result {

0 commit comments

Comments
 (0)