picgo/router/router.go
2024-07-12 20:32:33 +08:00

21 lines
543 B
Go

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