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

vweb: add .mount_static_folder_at/2 , use it instead of app.handle_static in the server_sent_events example

This commit is contained in:
Delyan Angelov
2021-03-02 21:30:18 +02:00
parent eb4c60877e
commit cd423251da
2 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,6 @@
module main
import os
import rand
import time
import vweb
@ -15,7 +16,7 @@ fn main() {
pub fn (mut app App) init_once() {
app.serve_static('/favicon.ico', 'favicon.ico', 'img/x-icon')
app.handle_static('.', false)
app.mount_static_folder_at(os.resource_abs_path('.'), '/')
}
pub fn (mut app App) index() vweb.Result {