From fc32cc24e5211555053ffe056e387c0c01809e17 Mon Sep 17 00:00:00 2001 From: Petr Sloup Date: Mon, 27 Jun 2016 09:06:30 +0200 Subject: [PATCH] Properly add CORS to vector style endpoints --- src/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.js b/src/server.js index 458fb4f..a474eb2 100644 --- a/src/server.js +++ b/src/server.js @@ -63,6 +63,8 @@ module.exports = function(opts, callback) { var data = clone(config.data || {}); + app.use(cors()); + Object.keys(config.styles || {}).forEach(function(id) { var item = config.styles[id]; if (!item.style || item.style.length == 0) { @@ -104,8 +106,6 @@ module.exports = function(opts, callback) { app.use('/fonts/', serve_font(options, serving.fonts)); } - app.use(cors()); - Object.keys(data).forEach(function(id) { var item = data[id]; if (!item.mbtiles || item.mbtiles.length == 0) {