1
0
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:
Anton Zavodchikov
2021-05-01 16:20:10 +05:00
committed by GitHub
parent f82f1977d1
commit b621595c05
2 changed files with 117 additions and 90 deletions

View File

@ -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()
}