-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
64 lines (51 loc) · 1.91 KB
/
index.js
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
'use strict';
let path = require('path');
let config = require('bentojs-config');
// ### Bento
// Expose bento on the global scope.
global.Bento = module.exports = {};
// ### Paths
// Absolute paths to the various core concept folders of the bento api.
Bento.ROOT_PATH = path.join(__dirname, '../../');
Bento.NODE_MODULES = path.join(Bento.ROOT_PATH, 'node_modules');
Bento.CONFIG_PATH = path.join(Bento.ROOT_PATH, 'config');
Bento.INTERFACE_PATH = path.join(Bento.ROOT_PATH, 'interface');
Bento.MODULE_PATH = path.join(Bento.ROOT_PATH, 'modules');
Bento.SERVICE_PATH = path.join(Bento.ROOT_PATH, 'services');
Bento.POLICY_PATH = path.join(Bento.ROOT_PATH, 'policies');
Bento.PROVIDER_PATH = path.join(Bento.ROOT_PATH, 'providers');
Bento.HOOKS_PATH = path.join(Bento.ROOT_PATH, 'hooks');
Bento.STORAGE_PATH = path.join(Bento.ROOT_PATH, 'storage');
Bento.TEST_PATH = path.join(Bento.ROOT_PATH, 'test');
// ### NODE_ENV
// Shortcut constant to the current running NODE_ENV
Bento.ENV = process.env.NODE_ENV;
// ### Config
// Exposes the parsed api configuration on the bento object.
Bento.config = config(Bento.CONFIG_PATH);
// ### Testing
// A method that returns a boolean value of true if the current NODE_ENV
// is in a test state.
Bento.isTesting = function isTesting() {
return Bento.ENV === 'test';
};
// ### Bento Extensions
// List of modules that extends bento with new functionality
require('./lib/settings');
require('./lib/helpers');
require('./lib/event');
require('./lib/error');
require('./lib/log');
require('./lib/redis');
require('./lib/hooks');
require('./lib/auth');
require('./lib/store');
require('./lib/loader');
require('./lib/router');
require('./lib/resource');
require('./lib/interface');
require('./lib/socket');
require('./lib/access');
require('./run/bootstrap');
require('./run/server');
require('./run/app');