getCapabilitiesHandler.js 457 Bytes
Newer Older
Athanasios's avatar
Athanasios committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const assets = require("../src/assets");
const pug = require("pug");

const getCapabilitiesHandler = (req, res) => {

  assets.getPublicLayers().then(layers => {

    const compiledFunction = pug.compileFile("./views/capabilities.pug");
    let capabilities = compiledFunction({ layers: layers });
    res.set("Content-Type", "application/xml");
    res.status(200).send(capabilities);

  });

}

module.exports = { getCapabilitiesHandler };