Skip to content

Commit

Permalink
feat(controllers): prefix paths with api
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-zeman committed Jul 14, 2024
1 parent 177f4a3 commit 8727247
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/controllers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ func NewRouter(logger *slog.Logger, config *config.Config, repository *repositor
}

func (a API) mountTodoControllers(mux *http.ServeMux) {
mux.HandleFunc("GET /v1/todos", a.getTodos)
mux.HandleFunc("GET /v1/todos/{id}", a.getTodo)
mux.HandleFunc("POST /v1/todos", a.createTodo)
mux.HandleFunc("PUT /v1/todos/{id}", a.updateTodo)
mux.HandleFunc("DELETE /v1/todos/{id}", a.deleteTodo)
mux.HandleFunc("GET /api/v1/todos", a.getTodos)
mux.HandleFunc("GET /api/v1/todos/{id}", a.getTodo)
mux.HandleFunc("POST /api/v1/todos", a.createTodo)
mux.HandleFunc("PUT /api/v1/todos/{id}", a.updateTodo)
mux.HandleFunc("DELETE /api/v1/todos/{id}", a.deleteTodo)
}

type Response struct {
Expand Down

0 comments on commit 8727247

Please sign in to comment.