Merge branch 'ho-docker' into csh-ho-docker-issue-1338-bulk-upgrade

This commit is contained in:
Christopher Hoskin 2019-01-03 09:57:06 +00:00
commit 99709e558c
4 changed files with 775 additions and 1423 deletions

View file

@ -20,6 +20,7 @@ server.use bodyParser.json(limit: "2mb")
server.use metrics.http.monitor(logger) server.use metrics.http.monitor(logger)
server.del "/user/:user_id", SpellingAPIController.deleteDic server.del "/user/:user_id", SpellingAPIController.deleteDic
server.get "/user/:user_id", SpellingAPIController.getDic
server.post "/user/:user_id/check", SpellingAPIController.check server.post "/user/:user_id/check", SpellingAPIController.check
server.post "/user/:user_id/learn", SpellingAPIController.learn server.post "/user/:user_id/learn", SpellingAPIController.learn
server.get "/status", (req, res)-> server.get "/status", (req, res)->

View file

@ -27,3 +27,9 @@ module.exports = SpellingAPIController =
return next(error) if error? return next(error) if error?
res.sendStatus(204) res.sendStatus(204)
getDic: (req, res, next)->
logger.info token: req?.params?.user_id, "getting user dictionary"
SpellingAPIManager.getDic req.params.user_id, (error, words)->
return next(error) if error?
res.send(words)

View file

@ -49,3 +49,6 @@ module.exports = SpellingAPIManager =
deleteDic: (token, callback)-> deleteDic: (token, callback)->
LearnedWordsManager.deleteUsersLearnedWords token, callback LearnedWordsManager.deleteUsersLearnedWords token, callback
getDic: (token, callback)->
LearnedWordsManager.getLearnedWords token, callback

File diff suppressed because it is too large Load diff