From 8925da510ae7b3f005ccdc11971c799b12998ab8 Mon Sep 17 00:00:00 2001 From: Umputun Date: Sun, 4 Feb 2018 16:09:45 -0600 Subject: [PATCH] fake (for now) SiteID for /config --- README.md | 3 ++- app/rest/server.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dc792cb4..0af28c85 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,7 @@ type User struct { Picture string `json:"picture"` Profile string `json:"profile"` Admin bool `json:"admin"` + Blocked bool `json:"block"` } ``` @@ -187,7 +188,7 @@ Sort can be `time` or `score`. Supported sort order with prefix -/+, i.e. `-time ``` - `GET /api/v1/user` - get user info, _auth required_ - `PUT /api/v1/vote/{id}?site=site-id&url=post-url&vote=1` - vote for comment. `vote`=1 will increase score, -1 decrease. _auth required_ -- `GET /api/v1/config` - returns configuration (parameters) +- `GET /api/v1/config?site=siteID` - returns configuration (parameters) for given site ```go type config struct { Version string `json:"version"` diff --git a/app/rest/server.go b/app/rest/server.go index bf300864..07b08ebb 100644 --- a/app/rest/server.go +++ b/app/rest/server.go @@ -314,7 +314,7 @@ func (s *Server) findUserCommentsCtrl(w http.ResponseWriter, r *http.Request) { renderJSONFromBytes(w, r, data) } -// GET /config - returns configuration +// GET /config?site=siteID - returns configuration func (s *Server) configCtrl(w http.ResponseWriter, r *http.Request) { type config struct { Version string `json:"version"`