From 8b813e48206ee9d6d770b211304f64c0d3eb23f8 Mon Sep 17 00:00:00 2001 From: Umputun Date: Sun, 4 Feb 2018 15:12:14 -0600 Subject: [PATCH] map config json --- README.md | 1 + app/rest/server.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ab2fd74c..2b441e88 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,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) ### Admin diff --git a/app/rest/server.go b/app/rest/server.go index 979132cd..f1da4199 100644 --- a/app/rest/server.go +++ b/app/rest/server.go @@ -317,10 +317,10 @@ func (s *Server) findUserCommentsCtrl(w http.ResponseWriter, r *http.Request) { // GET /config - returns configuration func (s *Server) configCtrl(w http.ResponseWriter, r *http.Request) { type config struct { - Version string - EditDuration int - Admins []string - Auth []string + Version string `json:"version"` + EditDuration int `json:"edit_duration"` + Admins []string `json:"admins"` + Auth []string `json:"auth_providers"` } cnf := config{