mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
vweb: fix json() and text() results
This commit is contained in:
parent
288ea182a8
commit
02b846aa72
2 changed files with 14 additions and 11 deletions
|
@ -24,8 +24,8 @@ pub fn (mut app App) init_once() {
|
|||
pub fn (mut app App) init() {
|
||||
}
|
||||
|
||||
pub fn (mut app App) json_endpoint() {
|
||||
app.vweb.json('{"a": 3}')
|
||||
pub fn (mut app App) json_endpoint() vweb.Result {
|
||||
return app.vweb.json('{"a": 3}')
|
||||
}
|
||||
|
||||
pub fn (mut app App) index() vweb.Result {
|
||||
|
@ -37,11 +37,11 @@ pub fn (mut app App) index() vweb.Result {
|
|||
return $vweb.html()
|
||||
}
|
||||
|
||||
pub fn (mut app App) text() {
|
||||
app.vweb.text('Hello world from vweb')
|
||||
pub fn (mut app App) text() vweb.Result {
|
||||
return app.vweb.text('Hello world from vweb')
|
||||
}
|
||||
|
||||
pub fn (mut app App) cookie() {
|
||||
pub fn (mut app App) cookie() vweb.Result {
|
||||
app.vweb.set_cookie('cookie', 'test')
|
||||
app.vweb.text('Headers: $app.vweb.headers')
|
||||
return app.vweb.text('Headers: $app.vweb.headers')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue