-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
47 lines (41 loc) · 1.12 KB
/
config.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
var
config = {};
config.endpoint = {
url: "http://localhost",
port: "3000",
ssl: true
};
config.ssl = {
key: "./ssl/privatekey.pem",
certificate: "./ssl/certificate.pem"
};
config.tokens = {
expireTime: 48 * 60 * 60 * 1000
};
config.resource = {
original: {
host: "localhost",
port: 4000,
realm: "resourceServer",
loginPath: "/api/login",
regex: {
resourceOwner: /api\/(.*)\/.*/,
scope: /api\/.*(\/.*)/,
publicScope: /public\/.*/
}
},
proxy: {
port: 8000,
ssl: true
}
};
exports.config = config;
exports.setConfig = function (newConfig) {
newConfig.resource.original.regex.resourceOwner = eval(newConfig.resource.original.regex.resourceOwner);
newConfig.resource.original.regex.scope = eval(newConfig.resource.original.regex.scope);
newConfig.resource.original.regex.publicScope = eval(newConfig.resource.original.regex.publicScope);
config.endpoint = newConfig.endpoint;
config.ssl = newConfig.ssl;
config.tokens = newConfig.tokens;
config.resource = newConfig.resource;
}