mirror of
https://github.com/cubixle/tuu.git
synced 2026-04-24 21:24:43 +01:00
23 lines
291 B
Go
23 lines
291 B
Go
package tuu
|
|
|
|
import (
|
|
"github.com/gorilla/mux"
|
|
)
|
|
|
|
func New(r Router) *App {
|
|
return &App{router: r}
|
|
}
|
|
|
|
type App struct {
|
|
router Router
|
|
}
|
|
|
|
func (a *App) Serve() {
|
|
r := mux.NewRouter()
|
|
|
|
for _, route := range a.router.GetRoutes() {
|
|
r.Handle(route.Path, route).Methods(route.Method)
|
|
}
|
|
|
|
}
|