mirror of
https://github.com/cubixle/tuu.git
synced 2026-04-24 23:04:43 +01:00
initial commit
This commit is contained in:
22
tuu.go
Normal file
22
tuu.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user