diff --git a/cmd/tools/gen_vc.v b/cmd/tools/gen_vc.v index fd3b4a1023..ff8f5e2449 100644 --- a/cmd/tools/gen_vc.v +++ b/cmd/tools/gen_vc.v @@ -91,7 +91,7 @@ mut: struct WebhookServer { vweb.Context mut: - gen_vc &GenVC = 0 // initialized in init_once + gen_vc &GenVC = 0 // initialized in init_server } // storage for flag options @@ -156,12 +156,6 @@ pub fn (mut ws WebhookServer) init_server() { // ws.gen_vc = new_gen_vc(flag_options) } -/* -pub fn (mut ws WebhookServer) init() { - // ws.init_once() -} -*/ - pub fn (mut ws WebhookServer) index() { eprintln('WebhookServer.index() called') } @@ -198,7 +192,6 @@ fn parse_flags(mut fp flag.FlagParser) FlagOptions { } } -// init fn (mut gen_vc GenVC) init() { // purge repos if flag is passed if gen_vc.options.purge { diff --git a/examples/vweb/vweb_assets/vweb_assets.v b/examples/vweb/vweb_assets/vweb_assets.v index 36955307e5..03babaa634 100644 --- a/examples/vweb/vweb_assets/vweb_assets.v +++ b/examples/vweb/vweb_assets/vweb_assets.v @@ -16,7 +16,7 @@ fn main() { vweb.run(port) } -pub fn (mut app App) init_once() { +pub fn (mut app App) init_server() { // Arbitary mime type. app.serve_static('/favicon.ico', 'favicon.ico', 'img/x-icon') // Automatically make available known static mime types found in given directory. @@ -26,9 +26,6 @@ pub fn (mut app App) init_once() { app.handle_static('.', false) } -pub fn (mut app App) init() { -} - pub fn (mut app App) index() vweb.Result { // We can dynamically specify which assets are to be used in template. // mut am := assets.new_manager() diff --git a/examples/vweb/vweb_example.v b/examples/vweb/vweb_example.v index d0531848ea..9c066dd1eb 100644 --- a/examples/vweb/vweb_example.v +++ b/examples/vweb/vweb_example.v @@ -18,7 +18,7 @@ fn main() { vweb.run(port) } -pub fn (mut app App) init_once() { +pub fn (mut app App) init_server() { app.handle_static('.', false) } diff --git a/vlib/v/checker/tests/vweb_routing_checks.vv b/vlib/v/checker/tests/vweb_routing_checks.vv index fbd329f28e..d48c8a69fd 100644 --- a/vlib/v/checker/tests/vweb_routing_checks.vv +++ b/vlib/v/checker/tests/vweb_routing_checks.vv @@ -28,11 +28,11 @@ pub fn (mut app App) cow() vweb.Result { } /* -pub fn (app App) init_once() { +pub fn (app App) init_server() { // } -pub fn (app App) init() { +pub fn (app App) before_request() { // } */ diff --git a/vlib/vweb/tests/vweb_test_server.v b/vlib/vweb/tests/vweb_test_server.v index 88f3cf527f..576d58022a 100644 --- a/vlib/vweb/tests/vweb_test_server.v +++ b/vlib/vweb/tests/vweb_test_server.v @@ -37,10 +37,7 @@ fn main() { vweb.run_app(mut app, http_port) } -pub fn (mut app App) init() { -} - -pub fn (mut app App) init_once() { +pub fn (mut app App) init_server() { eprintln('>> webserver: started on http://127.0.0.1:$app.port/ , with maximum runtime of $app.timeout milliseconds.') }