1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vweb: detect mime type automatically in serve_static()

This commit is contained in:
Alexander Medvednikov
2021-05-22 07:02:21 +03:00
parent 788520eb52
commit dcfea5c69b
3 changed files with 8 additions and 5 deletions

View File

@ -15,7 +15,7 @@ fn main() {
}
pub fn (mut app App) init_server() {
app.serve_static('/favicon.ico', 'favicon.ico', 'img/x-icon')
app.serve_static('/favicon.ico', 'favicon.ico')
app.mount_static_folder_at(os.resource_abs_path('.'), '/')
}

View File

@ -18,7 +18,7 @@ fn main() {
pub fn (mut app App) init_server() {
// Arbitary mime type.
app.serve_static('/favicon.ico', 'favicon.ico', 'img/x-icon')
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