diff --git a/docs/endpoints.rst b/docs/endpoints.rst
index b6d3bbd..b3a5fa0 100644
--- a/docs/endpoints.rst
+++ b/docs/endpoints.rst
@@ -23,7 +23,7 @@ Rendered tiles
WMTS Capabilities
==============
-* WMTS Capabilities are served at ``/wmts/{id}/``
+* WMTS Capabilities are served at ``/styles/{id}/wmts.xml``
Static images
=============
diff --git a/public/templates/index.tmpl b/public/templates/index.tmpl
index 3dcef0d..2c61428 100644
--- a/public/templates/index.tmpl
+++ b/public/templates/index.tmpl
@@ -41,7 +41,7 @@
{{#if serving_data}}| {{/if}}TileJSON
{{/if}}
{{#if serving_rendered}}
- | WMTS
+ | WMTS
{{/if}}
{{#if xyz_link}}
| XYZ
diff --git a/src/server.js b/src/server.js
index 8d8ac3b..70edfe8 100644
--- a/src/server.js
+++ b/src/server.js
@@ -269,6 +269,7 @@ function start(opts) {
data['key_query_part'] =
req.query.key ? 'key=' + req.query.key + '&' : '';
data['key_query'] = req.query.key ? '?key=' + req.query.key : '';
+ if(template === 'wmts')res.set('Content-Type', 'text/xml');
return res.status(200).send(compiled(data));
});
resolve();
@@ -369,7 +370,7 @@ function start(opts) {
return res.redirect(301, '/styles/' + req.params.id + '/');
});
*/
- serveTemplate('/wmts/:id/$', 'wmts', function(req) {
+ serveTemplate('/styles/:id/wmts.xml', 'wmts', function(req) {
var id = req.params.id;
var wmts = clone((config.styles || {})[id]);
if (!wmts) {
@@ -381,7 +382,6 @@ function start(opts) {
wmts.id = id;
wmts.name = (serving.styles[id] || serving.rendered[id]).name;
wmts.baseUrl = (req.get('X-Forwarded-Protocol')?req.get('X-Forwarded-Protocol'):req.protocol) + '://' + req.get('host');
- console.log(wmts)
return wmts;
});