examples: fix static vweb assets example (#11008)
							parent
							
								
									dbf5c976a3
								
							
						
					
					
						commit
						eca7af107a
					
				|  | @ -1,7 +1,7 @@ | |||
| <html> | ||||
| <header> | ||||
| 	<title>@title</title> | ||||
| 	@css 'examples/vweb/vweb_assets/assets/index.css' | ||||
| 	@css 'index.css' | ||||
| </header> | ||||
| <body> | ||||
| 	<h1>@title</h1> | ||||
|  |  | |||
|  | @ -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 { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue