var fs = require("fs");
let moduleConfiguration = JSON.parse(fs.readFileSync('moduleConfiguration.json', 'utf8'));
module.exports = function(metadata) {
/**
* Return the endpoints available in the Driver Component
* @callback {Function} callback Callback function
* @param {Error|string} err Error object
* @param {metadataItem} result Result object
*/
metadata.getMetadata = function(callback) {
let driverMetadata = require("../driverImplementation/"+ moduleConfiguration.driver)().getDriverMetadata();
callback(null, driverMetadata);
/*
var err0 = new Error('Invalid input');
err0.statusCode = 405;
return cb(err0);
*/
}
metadata.remoteMethod('getMetadata',
{ isStatic: true,
produces: [ 'application/json' ],
accepts: [],
returns:
[ { description: 'manifest',
type: [ 'metadataItem' ],
arg: 'data',
root: true } ],
http: { verb: 'get', path: '' },
description: 'Return the endpoints available in the Driver Component' }
);
}