-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
53 lines (45 loc) · 1.78 KB
/
config.js
File metadata and controls
53 lines (45 loc) · 1.78 KB
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
module.exports = function (config) {
var module = {};
var pack = require('./package.json');
var replace = require("replaceall");
var path = require('path');
//App
module.app = {};
module.app.name = config.app_name || pack.name;
module.app.prefix = config.app_prefix || pack.name.substring(0,3).toUpperCase();
module.app.version = config.app_version || pack.version;
//Paths
module.path = {}
module.path.functions = config.path_path || "./public";
module.path.functions = path.join(process.cwd(), module.path.functions);
module.path.downloads = config.path_downloads || "./downloads";
module.path.downloads = path.join(process.cwd(), module.path.downloads);
module.path.uploads = config.path_uploads || "./uploads";
module.path.uploads = path.join(process.cwd(), module.path.uploads);
//HTTP
module.http = {};
module.http.hostname = config.http_hostname || '';
module.http.listen = config.http_listen || '';
module.http.port = config.http_port || 80;
//HTTPS
module.https = {};
module.https.hostname = config.https_hostname || '';
module.https.listen = config.https_listen || '';
module.https.port = config.https_port || 443;
module.https.ssl = {}
module.https.ssl.key = config.https_ssl_key || './key.pem'
module.https.ssl.key = path.join(process.cwd(), module.https.ssl.key);
module.https.ssl.cert = config.https_ssl_cert || './cert.pem';
module.https.ssl.cert = path.join(process.cwd(), module.https.ssl.cert);
//TCP
module.tcp = {};
module.tcp.hostname = config.tcp_hostname || '';
module.tcp.listen = config.tcp_listen || '';
module.tcp.port = config.tcp_port || 7691;
//UDP
module.udp = {};
module.udp.hostname = config.udp_hostname || '';
module.udp.listen = config.udp_listen || '';
module.udp.port = config.udp_port || 7692;
return module;
};