13 lines
222 B
Go
13 lines
222 B
Go
package main
|
|
|
|
import "net/http"
|
|
|
|
type staticRoute struct {
|
|
file []byte
|
|
mime string
|
|
}
|
|
|
|
func (s staticRoute) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|
w.Header().Add("Content-Type", s.mime)
|
|
w.Write(s.file)
|
|
}
|