mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
20 lines
315 B
Go
20 lines
315 B
Go
package base
|
|
|
|
import "net/http"
|
|
|
|
var (
|
|
// Routes all routes
|
|
Routes []Route
|
|
)
|
|
|
|
// Route map a path to a HandlerFunc
|
|
type Route struct {
|
|
Path string
|
|
Handler http.HandlerFunc
|
|
}
|
|
|
|
// Register register a route
|
|
func Register(path string, handler http.HandlerFunc) {
|
|
Routes = append(Routes, Route{path, handler})
|
|
}
|