2018-10-23 23:45:42 +08:00
|
|
|
'use strict';
|
|
|
|
|
2018-03-28 19:10:47 +08:00
|
|
|
const _ = require('underscore');
|
|
|
|
|
|
|
|
module.exports = function augmentLayergroupData () {
|
|
|
|
return function augmentLayergroupDataMiddleware (req, res, next) {
|
|
|
|
const layergroup = res.body;
|
|
|
|
|
|
|
|
// include in layergroup response the variables in serverMedata
|
|
|
|
// those variables are useful to send to the client information
|
|
|
|
// about how to reach this server or information about it
|
|
|
|
_.extend(layergroup, global.environment.serverMetadata);
|
|
|
|
|
|
|
|
next();
|
|
|
|
};
|
|
|
|
};
|