Permalink
Browse files

Merge pull request #3 from stevage/404

Add 404 code when no .png/.json
  • Loading branch information...
arrayjam committed Apr 5, 2015
2 parents 2239d8d + 89fb693 commit b640a17e82e6b9ea4a9cd3f8c841ec695deb46e4
Showing with 3 additions and 3 deletions.
  1. +3 −3 app.js
View
6 app.js
@@ -51,7 +51,7 @@ tilelive.list(mbtilesdirectory, function(err, tileinfo) {
if (!err) {
res.send(tilejson);
} else {
- res.send("TileJSON error: " + err + "\n");
+ res.status(404).send("TileJSON error: " + err + "\n");
}
});
@@ -67,7 +67,7 @@ tilelive.list(mbtilesdirectory, function(err, tileinfo) {
res.contentType('image/png');
res.send(tile);
} else {
- res.send("Tile rendering error: " + err + "\n");
+ res.status(404).send("Tile rendering error: " + err + "\n");
}
});
@@ -85,7 +85,7 @@ tilelive.list(mbtilesdirectory, function(err, tileinfo) {
if (!err) {
res.send(tile);
} else {
- res.send("Grid rendering error: " + err + "\n");
+ res.status(404).send("Grid rendering error: " + err + "\n");
}
});
});

0 comments on commit b640a17

Please sign in to comment.