-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
58 lines (51 loc) · 1.17 KB
/
Copy pathconfig.js
File metadata and controls
58 lines (51 loc) · 1.17 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
'use strict';
const config = {};
config.development = {
name: 'Shark API',
ocearch: {
url: 'http://www.ocearch.org/tracker/ajax',
},
geonames: {
host: 'http://api.geonames.org',
username: 'sbaum',
},
google: {
host: 'https://maps.googleapis.com/maps/api',
geocode: {
apiKey: 'AIzaSyB9v8siVtJtLHw5Oed7HdlMjaxxdG0i7Kw'
},
place: {
apiKey: 'AIzaSyBXgv7zclbdnybtEtHMFfRiXR4Tb_MtA2Q',
}
},
cache: false,
manifest: {
connections: [
{
routes: { cors: true },
port: process.env.PORT | 3030,
},
],
registrations: [
{ plugin: 'vision' },
{ plugin: 'inert' },
{ plugin: 'hapi-swagger' },
{ plugin: 'blipp' },
{ plugin: './pulse' },
{ plugin: './get-shark-locations' },
{ plugin: './get-recent' },
{ plugin: './get-detailed' }
],
}
}
config.test = Object.assign({}, config.development);
const envs = ['development', 'test'];
function load() {
const valid = envs.filter(env => env === process.env.NODE_ENV).length > 0;
if (valid) {
return config[process.env.NODE_ENV];
} else {
return config.development;
}
}
module.exports = load();