mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vweb: add host option to controller (#18303)
This commit is contained in:
@@ -119,6 +119,12 @@ pub fn (mut app App) not_found() vweb.Result {
|
||||
return app.html('404 on "${app.req.url}"')
|
||||
}
|
||||
|
||||
[host: 'example.com']
|
||||
['/with_host']
|
||||
pub fn (mut app App) with_host() vweb.Result {
|
||||
return app.ok('')
|
||||
}
|
||||
|
||||
pub fn (mut app App) shutdown() vweb.Result {
|
||||
session_key := app.get_cookie('skey') or { return app.not_found() }
|
||||
if session_key != 'superman' {
|
||||
|
||||
Reference in New Issue
Block a user