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

vweb: fix index (#5682)

This commit is contained in:
Louis Schmieder
2020-07-05 22:05:58 +02:00
committed by GitHub
parent d0e321c8a3
commit 3cd9e2cab7
2 changed files with 8 additions and 1 deletions

View File

@ -346,6 +346,13 @@ fn handle_conn<T>(conn net.Socket, mut app T) {
// since such methods have a priority.
// For example URL `/register` matches route `/:user`, but `fn register()`
// should be called first.
if url_words.len == 0 {
app.index()
conn.close() or {}
return
}
println('no attrs for ${url_words[0]}')
if url_words[0] == method {
println('easy match $method')