Verified Commit d1eac1f5 authored by Martin Raifer's avatar Martin Raifer
Browse files

replace server script with actual one used for serving pop tiles

parent 91b4d0ed
......@@ -2,7 +2,7 @@ const express = require('express');
const http = require('http');
const app = express();
const tilelive = require('tilelive');
require('mbtiles').registerProtocols(tilelive);
require('@mapbox/mbtiles').registerProtocols(tilelive);
const mbtileFile = process.argv.length >= 2 ? process.argv[2] : null;
......@@ -10,8 +10,8 @@ if (!mbtileFile) {
console.error('Select the mbtile file!!');
process.exit(1);
}
console.log('Openning', `mbtiles:///opt/osm-cruncher/app/results/${mbtileFile}.mbtiles`);
tilelive.load(`mbtiles:///opt/osm-cruncher/app/results/${mbtileFile}.mbtiles`, function(err, source) {
console.log('Openning', `mbtiles://${mbtileFile}`);
tilelive.load(`mbtiles://${mbtileFile}`, function(err, source) {
if (err) {
throw err;
}
......@@ -23,7 +23,7 @@ tilelive.load(`mbtiles:///opt/osm-cruncher/app/results/${mbtileFile}.mbtiles`, f
next();
});
app.get(`/${mbtileFile}/:z/:x/:y.pbf`, function(req, res){
app.get('/:z/:x/:y.pbf', function(req, res){
var z = req.params.z;
var x = req.params.x;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment