mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
picoev: error handling workaround (#9913)
This commit is contained in:
parent
f82f1977d1
commit
b621595c05
2 changed files with 117 additions and 90 deletions
|
@ -2,6 +2,10 @@ import json
|
|||
import picoev
|
||||
import picohttpparser
|
||||
|
||||
const (
|
||||
port = 8088
|
||||
)
|
||||
|
||||
struct Message {
|
||||
message string
|
||||
}
|
||||
|
@ -43,6 +47,6 @@ fn callback(data voidptr, req picohttpparser.Request, mut res picohttpparser.Res
|
|||
}
|
||||
|
||||
fn main() {
|
||||
println('Starting webserver on http://127.0.0.1:8088/ ...')
|
||||
picoev.new(8088, &callback).serve()
|
||||
println('Starting webserver on http://127.0.0.1:$port/ ...')
|
||||
picoev.new(port: port, cb: &callback).serve()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue