Child: [8d7ecf] (diff)

Download this file

driver.js    43 lines (32 with data), 1.1 kB

 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(driver) {
/**
* Function to retrieve the file manifest of the Drivers component
* @param {string} driverId Driver ID
* @callback {Function} callback Callback function
* @param {Error|string} err Error object
* @param {manifestDoc} result Result object
*/
driver.getManifest = function(callback) {
let driverMetadata = require("../driverImplementation/"+ moduleConfiguration.driver)().getDriverMetadata();
callback(null, driverMetadata);
/*
var err0 = new Error('Invalid input');
err0.statusCode = 405;
return cb(err0);
*/
}
driver.remoteMethod('getManifest',
{ isStatic: true,
produces: [ 'application/json' ],
accepts: [],
returns:
[ { description: 'manifest',
type: 'manifestDoc',
arg: 'data',
root: true } ],
http: { verb: 'get', path: '/drivers/manifest' },
description: 'Function to retrieve the file manifest of the Drivers component' }
);
}