1
0
mirror of https://github.com/taigrr/wasm-experiments synced 2025-01-18 04:03:21 -08:00
2018-08-11 20:55:13 +01:00

19 lines
379 B
Go

package main
import (
"log"
"net/http"
)
func main() {
fs := http.FileServer(http.Dir("./html"))
log.Print("Serving on http://localhost:8080")
http.ListenAndServe(":8080", http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
if req.URL.Path == "/test.wasm" {
resp.Header().Set("content-type", "application/wasm")
}
fs.ServeHTTP(resp, req)
}))
}