-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.js
110 lines (103 loc) · 4.98 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import indexes from './algoliaIndexes';
// eslint-disable-next-line import/no-mutable-exports
let config;
if (
typeof window === 'undefined' ||
process.env.APP_ENV === 'testing' ||
process.env.APP_ENV === 'cypress'
) {
const production = {
ALGOLIA_SEARCH_KEY: '8ea4ffa0588206bb0c0751294097e875',
ALGOLIA_APPLICATION_ID: 'GC7K0ETHXB',
ALGOLIA_INDEX_TECHNOLOGY: `${indexes.technology.default}_production`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_TECHNOLOGY: `${indexes.technology.suggestions}_production`,
ALGOLIA_INDEX_IDEA: `${indexes.idea.default}_production`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_IDEA: `${indexes.idea.suggestions}_production`,
ALGOLIA_INDEX_SERVICE: `${indexes.service.default}_production`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_SERVICE: `${indexes.service.suggestions}_production`,
ALGOLIA_INDEX_ANNOUNCEMENT: `${indexes.announcement.default}_production`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_ANNOUNCEMENT: `${indexes.announcement.suggestions}_production`,
ALGOLIA_INDEX_INSTITUTION: `${indexes.institution.default}_production`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_INSTITUTION: `${indexes.institution.suggestions}_production`,
API_URL: 'https://api.plataformasabia.com',
GOOGLE_MAPS_KEY: process.env.GOOGLE_MAPS_KEY,
SMARTSUP_KEY: process.env.SMARTSUP_KEY,
APP_ENV: 'production',
LOAD_ANALYTICS: true,
LOAD_HOTJAR: true,
LOAD_SMARTSUP: true,
};
const staging = {
ALGOLIA_SEARCH_KEY: '8ea4ffa0588206bb0c0751294097e875',
ALGOLIA_APPLICATION_ID: 'GC7K0ETHXB',
ALGOLIA_INDEX_TECHNOLOGY: `${indexes.technology.default}_staging`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_TECHNOLOGY: `${indexes.technology.suggestions}_staging`,
ALGOLIA_INDEX_IDEA: `${indexes.idea.default}_staging`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_IDEA: `${indexes.idea.suggestions}_staging`,
ALGOLIA_INDEX_SERVICE: `${indexes.service.default}_staging`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_SERVICE: `${indexes.service.suggestions}_staging`,
ALGOLIA_INDEX_ANNOUNCEMENT: `${indexes.announcement.default}_staging`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_ANNOUNCEMENT: `${indexes.announcement.suggestions}_staging`,
ALGOLIA_INDEX_INSTITUTION: `${indexes.institution.default}_staging`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_INSTITUTION: `${indexes.institution.suggestions}_staging`,
API_URL: 'https://api-staging.plataformasabia.com',
GOOGLE_MAPS_KEY: process.env.GOOGLE_MAPS_KEY,
SMARTSUP_KEY: process.env.SMARTSUP_KEY,
APP_ENV: 'staging',
LOAD_ANALYTICS: false,
LOAD_HOTJAR: false,
LOAD_SMARTSUP: false,
};
const testing = {
ALGOLIA_SEARCH_KEY: '8ea4ffa0588_test',
ALGOLIA_APPLICATION_ID: 'GC7K0E_test',
ALGOLIA_INDEX_TECHNOLOGY: `${indexes.technology.default}_test`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_TECHNOLOGY: `${indexes.technology.suggestions}_test`,
ALGOLIA_INDEX_IDEA: `${indexes.idea.default}_test`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_IDEA: `${indexes.idea.suggestions}_test`,
ALGOLIA_INDEX_SERVICE: `${indexes.service.default}_test`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_SERVICE: `${indexes.service.suggestions}_test`,
ALGOLIA_INDEX_ANNOUNCEMENT: `${indexes.announcement.default}_test`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_ANNOUNCEMENT: `${indexes.announcement.suggestions}_test`,
ALGOLIA_INDEX_INSTITUTION: `${indexes.institution.default}_test`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_INSTITUTION: `${indexes.institution.suggestions}_test`,
API_URL: 'http://127.0.0.1:3334',
GOOGLE_MAPS_KEY: process.env.GOOGLE_MAPS_KEY,
SMARTSUP_KEY: process.env.SMARTSUP_KEY,
APP_ENV: 'testing',
LOAD_ANALYTICS: false,
LOAD_HOTJAR: false,
LOAD_SMARTSUP: false,
};
const development = {
ALGOLIA_SEARCH_KEY: process.env.ALGOLIA_SEARCH_KEY,
ALGOLIA_APPLICATION_ID: process.env.ALGOLIA_APPLICATION_ID,
ALGOLIA_INDEX_TECHNOLOGY: `${indexes.technology.default}_development`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_TECHNOLOGY: `${indexes.technology.suggestions}_development`,
ALGOLIA_INDEX_IDEA: `${indexes.idea.default}_development`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_IDEA: `${indexes.idea.suggestions}_development`,
ALGOLIA_INDEX_SERVICE: `${indexes.service.default}_development`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_SERVICE: `${indexes.service.suggestions}_development`,
ALGOLIA_INDEX_ANNOUNCEMENT: `${indexes.announcement.default}_development`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_ANNOUNCEMENT: `${indexes.announcement.suggestions}_development`,
ALGOLIA_INDEX_INSTITUTION: `${indexes.institution.default}_development`,
ALGOLIA_QUERY_SUGGESTIONS_INDEX_INSTITUTION: `${indexes.announcement.institution}_development`,
API_URL: process.env.API_URL,
GOOGLE_MAPS_KEY: process.env.GOOGLE_MAPS_KEY,
SMARTSUP_KEY: process.env.SMARTSUP_KEY,
APP_ENV: 'development',
LOAD_ANALYTICS: false,
LOAD_HOTJAR: false,
LOAD_SMARTSUP: false,
};
config = {
...development,
...(process.env.APP_ENV === 'testing' ? testing : {}),
...(process.env.APP_ENV === 'cypress' ? testing : {}),
...(process.env.APP_ENV === 'staging' ? staging : {}),
...(process.env.APP_ENV === 'production' ? production : {}),
};
} else {
config = window.env || {};
}
export default config;