mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
picoev: error handling workaround (#9913)
This commit is contained in:

committed by
GitHub

parent
f82f1977d1
commit
b621595c05
@ -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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user