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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user