-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
executable file
·85 lines (67 loc) · 1.42 KB
/
Copy pathconfig.js
File metadata and controls
executable file
·85 lines (67 loc) · 1.42 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**
* Configuration library. Handles config file parsing.
* Application must be restarted for changes to take place
*/
var fs = require('fs');
/**
* Change application settings using this object
* changes will be reflected across all modules
*/
var settings = {
"application": {
"in_production": false
},
// ip of server hosting auvsi
// obstacle and competition data
"auvsi": {
"host": "192.168.1.132",
"port": 8000,
"username": "admin",
"password": "pass",
"admin": false
},
// telemetry and gcs connection settings
"mavlink": {
"incoming_host": "0.0.0.0",
"incoming_port": 14561,
"outgoing_host": "192.168.4.7", // 137.155.2.166
"outgoing_port": 14562
},
// used for sda
"grid": {
"grid_width": 100,
"grid_padding_height": 10
},
// the web-client is served here
"http": {
"host": "0.0.0.0",
"port": 8000
}
};
/**
* If changing a setting, please do not alter object below
* it is only there to expose a config manager api
*/
var config = {
DEFAULT_CONFIG_FILE: './config.json',
set_setting: function(key, value) {
settings[key] = value;
},
/**
* Replaces entire config object with new one
*/
set_config: function(new_conf) {
settings = new_conf;
},
/**
* Retrieves entire config object, or
* a specific property
*/
get_config: function(setting_id) {
if(setting_id) {
return settings[setting_id];
}
return settings;
}
};
module.exports = config;