| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package main
- import "net/http"
- type Route struct {
- Path string
- Handler http.HandlerFunc
- }
- var routes = []Route{
- {
- "/api/auth/login",
- loginHandler,
- },
- {
- "/api/auth/logout",
- logoutHandler,
- },
- {
- "/api/device/imei",
- getIMEIHandler,
- },
- {
- "/api/service/log",
- serviceLogHandler,
- },
- {
- "/api/network/interfaces",
- netInterfaces,
- },
- {
- "/api/network/routes",
- netRoutes,
- },
- {
- "/api/network/dns",
- netDNS,
- },
- }
- func registerRoutes(mux *http.ServeMux) {
- for _, r := range routes {
- mux.HandleFunc(r.Path, r.Handler)
- }
- }
|