forked from bergos/ldapp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathldapp.js
30 lines (26 loc) · 1.16 KB
/
ldapp.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
var
config = require('./data/config'),
express = require('express'),
coreModule = new (require('./lib/core-module'))(config),
authNModule = new (require('./lib/authn-module'))(config),
staticModule = new (require('./lib/static-module'))(config),
graphModule = new (require('./lib/graph-module'))(config),
corsProxyModule = new (require('./lib/cors-proxy-module'))(config),
listenerModule = new (require('./lib/listener-module'))(config);
coreModule.init()
.then(function (app) { return authNModule.init(app); })
.then(function (app) { return staticModule.init(app); })
.then(function (app) { return corsProxyModule.init(app, '/cors'); })
.then(function (app) { return graphModule.init(app); })
.then(function (app) { return listenerModule.init(app); })
.then(function (app) {
/*var fs = require('fs');
config.rdf.parseTurtle(fs.readFileSync('./data/access1.ttl').toString(), function (graph) {
graphModule.events.add('https://localhost:8443/.access', graph, function (added) {
console.log('added: ' + added.toArray().length);
});
});*/
return app;
}).catch(function (error) {
console.error(error.stack);
});