Download this file

metadata.js    43 lines (31 with data), 999 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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' }
);
}