Permalink
Browse files

nicer api

  • Loading branch information...
1 parent 2deb399 commit 91648601edd3502da5fc3481d48c51d69496553d @tj tj committed Dec 18, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 routes.js
View
@@ -14,16 +14,15 @@ var dir = app.get('screenshots')
*/
app.get('/', function(req, res, next){
- if (req.query.url) return next();
res.render('index', { title: 'Express' });
});
/*
* GET screenshot.
*/
-app.get('/', ratelimit(100, 10), function(req, res, next){
- var url = req.query.url;
+app.get('/:url(*)', ratelimit(100, 10), function(req, res, next){
+ var url = req.params.url;
if (!url) return res.send(400);
var id = utils.md5(url);
var path = join(dir, id + '.png');

0 comments on commit 9164860

Please sign in to comment.