diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-24 12:33:51 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-24 12:33:51 -0400 |
| commit | b817d4472ca905a0d380cf686ffa62f62297574a (patch) | |
| tree | e97c895a4d9275069e7ac5fda37dd899addae63a /lib/index.js | |
| parent | f2215b36f3e1844ac058e7e7cfef6a53083efef9 (diff) | |
db calls
Diffstat (limited to 'lib/index.js')
| -rw-r--r-- | lib/index.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/index.js b/lib/index.js index 0cc00a9..fd226e5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -38,9 +38,18 @@ site.init = function(){ app.get("/p/:id", function(req, res){}) app.get("/get/random", function(req, res){ + db.getRandom().then(function(img){ + res.json(img) + }) }) app.get("/get/latest", function(req, res){ + db.getLatest().then(function(img){ + res.json(img) + }) }) app.get("/get/:id", function(req, res){ + db.getImage(id).then(function(img){ + res.json(img) + }) }) }
\ No newline at end of file |
