Skip to content

Commit

Permalink
Merge pull request #7 from mapbox/older-node
Browse files Browse the repository at this point in the history
Document dependencies; avoid => syntax to work with older node.js
  • Loading branch information
defvol committed May 6, 2016
2 parents 9da31aa + 106f5d3 commit 6f432ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Watch MBTiles in your localhost
![demo](https://raw.githubusercontent.com/mapbox/mbview/master/demo.gif)

```bash
% npm install
% open http://localhost:9000
% node server.js --mbtiles ~/foo.mbtiles --port 9000
```
8 changes: 4 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function loadTiles(path) {
const mb = new MBTiles(path, function(err, mbtiles) {
if (err) throw err;
tiles = mbtiles;
mbtiles.getInfo((err, data) => {
mbtiles.getInfo(function(err, data) {
if (err) throw err;
console.log('*** Metadata found in the MBTiles');
console.log(data);
Expand All @@ -50,14 +50,14 @@ function loadTiles(path) {

}

app.get('/', (req, res) => {
app.get('/', function(req, res) {
res.render('map', { config: config });
});

app.get('/debug/:z/:x/:y.pbf', (req, res) => {
app.get('/debug/:z/:x/:y.pbf', function(req, res) {
var p = req.params;
console.log('Serving', p.z + '/' + p.x + '/' + p.y);
tiles.getTile(p.z, p.x, p.y, (err, tile, headers) => {
tiles.getTile(p.z, p.x, p.y, function(err, tile, headers) {
if (err) {
console.error(err);
res.end();
Expand Down

0 comments on commit 6f432ec

Please sign in to comment.