diff --git a/examples/vweb/vweb_example.v b/examples/vweb/vweb_example.v index c7a0267bb5..465ce7c1fa 100644 --- a/examples/vweb/vweb_example.v +++ b/examples/vweb/vweb_example.v @@ -18,6 +18,10 @@ mut: cnt int } +pub fn (app App) before_request() { + println('[Vweb] $app.Context.req.method $app.Context.req.url') +} + fn main() { println('vweb example') vweb.run(&App{}, port) diff --git a/examples/vweb_orm_jwt/src/main.v b/examples/vweb_orm_jwt/src/main.v index b48f6e6601..ef7dcd40fd 100644 --- a/examples/vweb_orm_jwt/src/main.v +++ b/examples/vweb_orm_jwt/src/main.v @@ -11,12 +11,16 @@ struct App { vweb.Context } +pub fn (app App) before_request() { + println('[Vweb] $app.Context.req.method $app.Context.req.url') +} + fn main() { mut db := databases.create_db_connection() or { panic(err) } sql db { create table User - } + } or { panic('error on create table: $err') } db.close() or { panic(err) }