diff options
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, |
