1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vweb: add json_pretty method (#12745)

This commit is contained in:
Toby Webb
2021-12-06 23:31:17 +01:00
committed by GitHub
parent 047f059fb8
commit ef16a8ec54
2 changed files with 19 additions and 0 deletions

View File

@@ -64,3 +64,15 @@ pub fn (mut app App) new_article() vweb.Result {
fn (mut app App) time() {
app.text(time.now().format())
}
fn (mut app App) time_json() {
app.json({
'time': time.now().format()
})
}
fn (mut app App) time_json_pretty() {
app.json_pretty({
'time': time.now().format()
})
}