summaryrefslogtreecommitdiffstats
path: root/server/lib/external-backends/external-backends.js
diff options
context:
space:
mode:
authorJannik Schönartz2018-07-17 04:43:31 +0200
committerJannik Schönartz2018-07-17 04:43:31 +0200
commite4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3 (patch)
tree0c40021f77fea9688449c9c4d6e6222a809ec3d6 /server/lib/external-backends/external-backends.js
parent[webapp] renamed components (diff)
downloadbas-e4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3.tar.gz
bas-e4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3.tar.xz
bas-e4c4d0e3d7dc7be7ac233cd6c9b90ae92fb1a5b3.zip
[server] Fixed eslint errors. (Standard ESLint is used)
Diffstat (limited to 'server/lib/external-backends/external-backends.js')
-rw-r--r--server/lib/external-backends/external-backends.js48
1 files changed, 24 insertions, 24 deletions
diff --git a/server/lib/external-backends/external-backends.js b/server/lib/external-backends/external-backends.js
index 5ab2adf..0bf891e 100644
--- a/server/lib/external-backends/external-backends.js
+++ b/server/lib/external-backends/external-backends.js
@@ -1,30 +1,30 @@
/* global __appdir */
-const fs = require('fs');
-const path = require('path');
+const fs = require('fs')
+const path = require('path')
class ExternalBackends {
- getBackends() {
- var files = fs.readdirSync(path.join(__appdir, 'lib', 'external-backends', 'backends'));
- return files;
- }
-
- getCredentials() {
- return "If this method gets called the backend class has NOT IMPLEMENTED the getCredentials method!";
- }
-
- getInstance(type) {
- const bList = this.getBackends();
- const bType = type + '-backend.js';
-
- // Check if it's a valid backend type.
- if (bList.indexOf(bType) == -1) {
- console.log(bType + " is not a valid backend type.");
- return null;
- }
-
- const backend = new (require(path.join(__appdir, 'lib', 'external-backends', 'backends', bType)))();
- return backend;
+ getBackends () {
+ var files = fs.readdirSync(path.join(__appdir, 'lib', 'external-backends', 'backends'))
+ return files
+ }
+
+ getCredentials () {
+ return 'If this method gets called the backend class has NOT IMPLEMENTED the getCredentials method!'
+ }
+
+ getInstance (type) {
+ const bList = this.getBackends()
+ const bType = type + '-backend.js'
+
+ // Check if it's a valid backend type.
+ if (bList.indexOf(bType) === -1) {
+ console.log(bType + ' is not a valid backend type.')
+ return null
}
+
+ const backend = new (require(path.join(__appdir, 'lib', 'external-backends', 'backends', bType)))()
+ return backend
+ }
}
-module.exports = ExternalBackends;
+module.exports = ExternalBackends