mirror of
https://github.com/vlang/v.git
synced 2025-09-08 23:07:19 -04:00
vweb: fix routes without results in vweb_app_test.v (#20548)
This commit is contained in:
parent
508117d62f
commit
3b19864aa3
@ -18,13 +18,13 @@ struct Article {
|
||||
}
|
||||
|
||||
fn test_a_vweb_application_compiles() {
|
||||
spawn fn () {
|
||||
time.sleep(2 * time.second)
|
||||
exit(0)
|
||||
}()
|
||||
vweb.run(&App{}, 18081)
|
||||
}
|
||||
|
||||
pub fn (mut app App) before_accept_loop() {
|
||||
exit(0)
|
||||
}
|
||||
|
||||
pub fn (mut app App) before_request() {
|
||||
app.user_id = app.get_cookie('id') or { '0' }
|
||||
}
|
||||
@ -49,18 +49,18 @@ pub fn (mut app App) new_article() vweb.Result {
|
||||
return app.redirect('/')
|
||||
}
|
||||
|
||||
fn (mut app App) time() {
|
||||
app.text(time.now().format())
|
||||
fn (mut app App) time() vweb.Result {
|
||||
return app.text(time.now().format())
|
||||
}
|
||||
|
||||
fn (mut app App) time_json() {
|
||||
app.json({
|
||||
fn (mut app App) time_json() vweb.Result {
|
||||
return app.json({
|
||||
'time': time.now().format()
|
||||
})
|
||||
}
|
||||
|
||||
fn (mut app App) time_json_pretty() {
|
||||
app.json_pretty({
|
||||
fn (mut app App) time_json_pretty() vweb.Result {
|
||||
return app.json_pretty({
|
||||
'time': time.now().format()
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user