picgo/router/router.go

16 lines
294 B
Go

package router
import (
"net/http"
"picgo/handler"
)
func InitRouter() *http.ServeMux {
var mux *http.ServeMux
// 创建新的路由器
mux = http.NewServeMux()
mux.HandleFunc("/static/", handler.StaticHandler)
mux.HandleFunc("/api/v1/upload", handler.UploadFileHandler)
return mux
}