-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
55 lines (44 loc) · 1.06 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
/**
* This file is part of Noder.io.
*
* (c) Nicolas Tallefourtane <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code
* or visit {@link http://noder.io|Noder.io}.
*
* @author Nicolas Tallefourtane <[email protected]>
*/
'use strict';
var noder = require('noder.io');
var debug = noder.debug;
// express application
var app;
/**
* noder.app
* @augments noder
* @return {object} Returns an express application (augmented)
*/
Object.defineProperty(noder, 'app', {
get: function() {
if (app) {
return app;
}
app = require('./lib/application')(this);
return app;
}
});
/**
* noder.isApp()
* Cheks if the app is initialized
* @augments noder
* @return {function}
*/
noder.isApp = function() {
return undefined !== app;
};
noder.lazyLoader.register('router', 'noder.io-app/lib/router');
noder.lazyLoader.register('express', 'express');
noder.lazyLoader.register('load', 'express-load');
debug('noder:app')('init');
module.exports = noder;