-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (35 loc) · 1.14 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
var ServiceBuilder = require('./source/service_builder'),
config = require('./source/config');
module.exports = {
Domain: require('./source/domain_model'),
DomainField: require('./source/domain_field'),
AddService: function(domainObject, server){
var service = ServiceBuilder.build(domainObject);
service.routes.map(function(route){
server.route(route);
});
},
Config: function(settings){
if(settings.db){
if(settings.db.connectionString){
config.db.connectionString = settings.db.connectionString;
}
if(settings.db.host){
config.db.host = settings.db.host;
}
if(settings.db.port){
config.db.port = settings.db.port;
}
if(settings.db.database){
config.db.database = settings.db.database;
}
if(settings.db.user){
config.db.user = settings.db.user;
}
if(settings.db.pass){
config.db.pass = settings.db.pass;
}
};
console.log(settings.db);
}
}