simple-odata-server
Version:
OData server with adapter for mongodb and nedb
23 lines (19 loc) • 466 B
JavaScript
/*!
* Copyright(c) 2014 Jan Blaha (pofider)
*
* Orchestrate the OData / request
*/
module.exports = function (cfg) {
var collections = [];
for (var key in cfg.model.entitySets) {
collections.push({
"kind": "EntitySet",
"name": key,
"url": key
})
}
return JSON.stringify({
"@odata.context": cfg.serviceUrl + "/$metadata",
"value": collections
});
};