- Update API routes for consistency and versioning. any communication with donetick will go through /api/v1
. for external will user prefix /eapi/v1
- Update Readme and add Discord and Reddit - changing the api url should fix #71
This commit is contained in:
commit
310a717294
8 changed files with 26 additions and 10 deletions
|
@ -46,7 +46,7 @@ func (h *API) GetAllChores(c *gin.Context) {
|
|||
|
||||
func APIs(cfg *config.Config, api *API, r *gin.Engine, auth *jwt.GinJWTMiddleware, limiter *limiter.Limiter) {
|
||||
|
||||
thingsAPI := r.Group("api/v1/chore")
|
||||
thingsAPI := r.Group("eapi/v1/chore")
|
||||
|
||||
thingsAPI.Use(utils.TimeoutMiddleware(cfg.Server.WriteTimeout), utils.RateLimitMiddleware(limiter))
|
||||
{
|
||||
|
|
|
@ -1417,7 +1417,7 @@ func indexOf(arr []chModel.ChoreAssignees, value int) int {
|
|||
|
||||
func Routes(router *gin.Engine, h *Handler, auth *jwt.GinJWTMiddleware) {
|
||||
|
||||
choresRoutes := router.Group("chores")
|
||||
choresRoutes := router.Group("api/v1/chores")
|
||||
choresRoutes.Use(auth.MiddlewareFunc())
|
||||
{
|
||||
choresRoutes.GET("/", h.getChores)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue