func GetUserRouter() *giny.Router { router := giny.NewRouter() router.On("/login", UserLogin) router.On("/register", UserRegister) router.On("/info", UserInformations) router.On("/item/:id", GetItem) router.On("/list", GetList) router.On("/", UserInformations) return router }
func main() { fmt.Println("starting server on port 8000") // app := giny.NewApplication() /** * Register route */ base := giny.NewRouter() // register app.RegisterRouter("/api", api.GetUserRouter()) app.RegisterRouter("/", base) // finally start your application app.Run() }