v
v copied to clipboard
vweb: add an option to disable startup message
add msg: false
to vweb.RunParams
to disable [VWeb] Running app on ...
refer to issue #17622
add an option msg: false
to RunParams to disable the message
msg
is true
by default
example:
vweb.run_at(&App{}, vweb.RunParams{
host: "localhost"
port: 8080
family: .ip
msg: false
})
Hmm... is it better to have startup_msg
as boolean?
What if you want to have a custom startup message?
You can print an output manually :) e.g.
println("[Vweb] Running app on http://localhost:8080/")
vweb.run_at(&App{}, vweb.RunParams{
host: "localhost"
port: 8080
family: .ip
startup_message: false
})
In V bools are usually named with is_x
or show_x
to make it clear they are bools.
startup_message
sounds like a string, it should be show_startup_message: false
Verbose, but clear.
startup_message
sounds like a string, it should beshow_startup_message: false
indeed, my bad
To be truly explicit (and even more verbose), it should be show_default_startup_message
- since it only affects the default.