mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vweb: remove init_server() from all examples, tutorials, and tests
This commit is contained in:
@ -11,12 +11,10 @@ struct App {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
vweb.run(&App{}, 8081)
|
||||
}
|
||||
|
||||
pub fn (mut app App) init_server() {
|
||||
mut app := &App{}
|
||||
app.serve_static('/favicon.ico', 'favicon.ico')
|
||||
app.mount_static_folder_at(os.resource_abs_path('.'), '/')
|
||||
vweb.run(app, 8081)
|
||||
}
|
||||
|
||||
pub fn (mut app App) index() vweb.Result {
|
||||
|
@ -23,10 +23,6 @@ fn main() {
|
||||
vweb.run(&App{}, port)
|
||||
}
|
||||
|
||||
pub fn (mut app App) init_server() {
|
||||
app.handle_static('.', false)
|
||||
}
|
||||
|
||||
['/users/:user']
|
||||
pub fn (mut app App) user_endpoint(user string) vweb.Result {
|
||||
id := rand.intn(100)
|
||||
|
Reference in New Issue
Block a user