mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vweb: route to index dynamically (#7782)
This commit is contained in:
@@ -60,7 +60,7 @@ fn assert_common_headers(received string) {
|
||||
}
|
||||
|
||||
fn test_a_simple_tcp_client_can_connect_to_the_vweb_server() {
|
||||
received := simple_tcp_client({}) or {
|
||||
received := simple_tcp_client(path: '/') or {
|
||||
assert err == ''
|
||||
return
|
||||
}
|
||||
|
@@ -44,13 +44,12 @@ pub fn (mut app App) init_once() {
|
||||
eprintln('>> webserver: started on http://127.0.0.1:$app.port/ , with maximum runtime of $app.timeout milliseconds.')
|
||||
}
|
||||
|
||||
pub fn (mut app App) index() {
|
||||
app.text('Welcome to VWeb')
|
||||
pub fn (mut app App) index() vweb.Result {
|
||||
return app.text('Welcome to VWeb')
|
||||
}
|
||||
|
||||
pub fn (mut app App) simple() vweb.Result {
|
||||
app.text('A simple result')
|
||||
return vweb.Result{}
|
||||
return app.text('A simple result')
|
||||
}
|
||||
|
||||
pub fn (mut app App) html_page() vweb.Result {
|
||||
|
Reference in New Issue
Block a user