diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-01-25 02:15:48 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-01-25 02:15:48 +0100 |
| commit | f8055775f3ac74e9e6054aef102673cefcf27986 (patch) | |
| tree | 6c7c302746db594ff0d61863f533633c7259de33 /bucky/app/api.js | |
| parent | 3975b8e7e2841298da1ad497ffe29ba004b55ec2 (diff) | |
more on profile
Diffstat (limited to 'bucky/app/api.js')
| -rw-r--r-- | bucky/app/api.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bucky/app/api.js b/bucky/app/api.js index 7a0e068..80cba16 100644 --- a/bucky/app/api.js +++ b/bucky/app/api.js @@ -32,6 +32,23 @@ function route (app){ function(req, res){ res.json(util.sanitizeUser(res.user)) }) + app.get("/api/profile/:username", + middleware.ensureAuthenticated, + bucky.ensureUser, + bucky.sanitizeUser, + bucky.ensureThreadsForUser, + // bucky.ensureTopThreadsForUser, + // bucky.ensureCommentsForUser, + bucky.ensureFilesForUser, + function(req, res) { + res.json({ + user: res.user, + threads: res.threads, + // topThreads: res.topThreads, + files: res.files, + // comments: res.comments, + }) + }) app.put("/api/checkUsernames", middleware.ensureAuthenticated, bucky.checkUsernames, |
