mirror of
https://github.com/taigrr/wasm-experiments
synced 2025-01-18 04:03:21 -08:00
Log messages when server exits
This commit is contained in:
parent
1fecaeb312
commit
b8bf9995ca
5
main.go
5
main.go
@ -8,11 +8,14 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
fs := http.FileServer(http.Dir("./html"))
|
fs := http.FileServer(http.Dir("./html"))
|
||||||
log.Print("Serving on http://localhost:8080")
|
log.Print("Serving on http://localhost:8080")
|
||||||
http.ListenAndServe(":8080", http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
|
err := http.ListenAndServe(":8080", http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
|
||||||
if req.URL.Path == "/test.wasm" {
|
if req.URL.Path == "/test.wasm" {
|
||||||
resp.Header().Set("content-type", "application/wasm")
|
resp.Header().Set("content-type", "application/wasm")
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.ServeHTTP(resp, req)
|
fs.ServeHTTP(resp, req)
|
||||||
}))
|
}))
|
||||||
|
if err != http.ErrServerClosed {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user