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

vweb: return $vweb.html()

This commit is contained in:
Alexander Medvednikov
2020-06-20 03:12:35 +02:00
parent e41ddab3b0
commit 1d8d19c977
7 changed files with 32 additions and 26 deletions

View File

@ -49,6 +49,8 @@ pub mut:
done bool
}
pub struct Result {}
fn (mut ctx Context) send_response_to_client(mimetype string, res string) bool {
if ctx.done { return false }
ctx.done = true
@ -372,6 +374,7 @@ pub fn (mut ctx Context) handle_static(directory_path string) bool {
return true
}
pub fn (mut ctx Context) serve_static(url, file_path, mime_type string) {
ctx.static_files[url] = file_path
ctx.static_mime_types[url] = mime_type