12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- package main
- import (
- "net/http"
- "rate-it-api/controllers"
- )
- // Route struct defining Route type
- type Route struct {
- Name string
- Method string
- Pattern string
- HandlerFunc http.HandlerFunc
- }
- // Routes collection of Route
- type Routes []Route
- var routes = Routes{
- Route{
- "Index",
- "GET",
- "/",
- controllers.Index,
- },
- Route{
- "AuthToken",
- "POST",
- "/auth",
- controllers.AuthToken,
- },
- Route{
- "UserCreate",
- "POST",
- "/user",
- controllers.UserCreate,
- },
- Route{
- "UserValidate",
- "GET",
- "/user/validation/{uuid}",
- controllers.UserValidate,
- },
- }
- // routesJwt routes protected by a JSON Web Token Authentification
- var routesJwt = Routes{
- Route{
- "TodoIndex",
- "GET",
- "/todos",
- controllers.TodoIndex,
- },
- Route{
- "TodoShow",
- "GET",
- "/todos/{todoId}",
- controllers.TodoShow,
- },
- }
|