1
0
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:
Casper Kuethe
2023-05-30 14:22:23 +02:00
committed by GitHub
parent 05b832a317
commit 4174048f96
6 changed files with 92 additions and 7 deletions

View File

@@ -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' {