diff --git a/examples/vweb/vweb_assets/index.html b/examples/vweb/vweb_assets/index.html index f687e58438..6635329ad0 100644 --- a/examples/vweb/vweb_assets/index.html +++ b/examples/vweb/vweb_assets/index.html @@ -1,7 +1,7 @@
@title - @css 'examples/vweb/vweb_assets/assets/index.css' + @css 'index.css'

@title

diff --git a/examples/vweb/vweb_assets/vweb_assets.v b/examples/vweb/vweb_assets/vweb_assets.v index 05d5da0ae4..058f45922b 100644 --- a/examples/vweb/vweb_assets/vweb_assets.v +++ b/examples/vweb/vweb_assets/vweb_assets.v @@ -13,17 +13,11 @@ struct App { } fn main() { - vweb.run(&App{}, port) -} - -pub fn (mut app App) init_server() { - // Arbitary mime type. + mut app := &App{} app.serve_static('/favicon.ico', 'favicon.ico') // Automatically make available known static mime types found in given directory. - // app.handle_static('assets') - // This would make available all known static mime types from current - // directory and below. - app.handle_static('.', false) + app.handle_static('assets', true) + vweb.run(app, port) } pub fn (mut app App) index() vweb.Result {