diff --git a/vlib/vweb/vweb.v b/vlib/vweb/vweb.v index 81571879ca..76b2569641 100644 --- a/vlib/vweb/vweb.v +++ b/vlib/vweb/vweb.v @@ -131,13 +131,13 @@ pub fn (ctx &Context) get_header(key string) string { pub fn run(port int) { mut app := T{} run_app(mut app, port) -} +} pub fn run_app(mut app T, port int) { println('Running a Vweb app on http://localhost:$port ...') l := net.listen(port) or { panic('failed to listen') } app.vweb = Context{} - app.init() + app.init_once() //app.reset() for { conn := l.accept() or { panic('accept() failed') } @@ -285,6 +285,7 @@ fn handle_conn(conn net.Socket, mut app T) { //$if debug { println('action=$action') //} + app.init() app.$action() /* app.$action() or { @@ -292,7 +293,7 @@ fn handle_conn(conn net.Socket, mut app T) { } */ conn.close() or {} - app.reset() + //app.reset() return }