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