diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-07-08 00:44:33 +0300 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-07-08 00:44:33 +0300 |
| commit | 7b5c0eb8844e75fd0dae2b816dd5a313dd657f92 (patch) | |
| tree | f39817441fa92d660cff816e287c1688cc501367 /lib/router.js | |
| parent | 0af98ba6002da726dfb511c7a7dccb1a858950aa (diff) | |
Add printing CRUD
Diffstat (limited to 'lib/router.js')
| -rw-r--r-- | lib/router.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/router.js b/lib/router.js index 55816d0..daddf5e 100644 --- a/lib/router.js +++ b/lib/router.js @@ -8,6 +8,14 @@ Router.route('/photos', {name: 'photos'}); Router.route('/about', {name: 'about'}); +Router.route('/prints', function () { + var self = this; + var res = Prints.find({ ts: { $gt: new Date().getTime() - 60000 } }).fetch() + self.response.setHeader('Content-Type', 'application/json'); + self.response.write(JSON.stringify(res)); + self.response.end(); +}, { where: 'server' }); + Router.route('/imgproxy', function () { var self = this; var url = 'http://scontent.cdninstagram.com' + this.request._parsedUrl.search.match(/url\=[^\&]+/)[0].split('=')[1]; |
