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

vweb: make thread safe; checker: $if T is Interface {

This commit is contained in:
Alexander Medvednikov
2021-05-11 09:30:01 +03:00
parent e310513a5f
commit dc034d9b16
17 changed files with 348 additions and 178 deletions

View File

@@ -30,16 +30,17 @@ fn main() {
assert timeout > 0
go exit_after_timeout(timeout)
//
mut app := App{
mut app := &App{
port: http_port
timeout: timeout
}
vweb.run_app<App>(mut app, http_port)
eprintln('>> webserver: started on http://127.0.0.1:$app.port/ , with maximum runtime of $app.timeout milliseconds.')
// vweb.run<App>(mut app, http_port)
vweb.run(mut app, http_port)
}
pub fn (mut app App) init_server() {
eprintln('>> webserver: started on http://127.0.0.1:$app.port/ , with maximum runtime of $app.timeout milliseconds.')
}
// pub fn (mut app App) init_server() {
//}
pub fn (mut app App) index() vweb.Result {
return app.text('Welcome to VWeb')