1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00
go-micro/api/handler/file/file.go

17 lines
283 B
Go
Raw Normal View History

2019-06-03 19:44:43 +02:00
// Package file serves file relative to the current directory
package file
import (
"net/http"
)
type Handler struct{}
func (h *Handler) Serve(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "."+r.URL.Path)
}
func (h *Handler) String() string {
return "file"
}