-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.js
217 lines (198 loc) · 5.66 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
/*!
* Copyright 2014 Digital Services, University of Cambridge Licensed
* under the Educational Community License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://opensource.org/licenses/ECL-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS"
* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
var bunyan = require('bunyan');
var config = module.exports = require('./config_private');
// Set the temporary files directory
var tmpDir = process.env.TMP || process.env.TMPDIR || process.env.TEMP || '/tmp' || process.cwd();
/**
* `config.app`
*
* @param {String} hostname The application host
* @param {String} root The application root
* @param {String} title The application title
* @param {String} ui The path to the static files
*/
config.app = {
'hostname': 'libraries-gateway.cam.ac.uk',
'root': __dirname,
'title': 'Cambridge Libraries',
'ui': __dirname + '/public'
};
/**
* `config.files`
*
* @param {String} tmpDir The directory where temporary files can be created
*/
config.files = {
'tmpDir': tmpDir
};
/**
* `config.server`
*
* @param {String} host
* @param {Number} port The network port on which the application can be accessed
* @param {String} protocol
*/
config.server = {
'host': 'localhost',
'port': 5000,
'protocol': 'http'
};
/**
* `config.log`
*
* @param {Stream[]} streams The Bunyan streams
* @param {Object} serializers The Bunyan serializers
*/
config.logger = {
'streams': [
{
'level': 'info',
'path': 'server.log'
}
],
'serializers': {
'err': bunyan.stdSerializers.err,
'req': bunyan.stdSerializers.req,
'res': bunyan.stdSerializers.res
}
};
/**
* `config.nodes`
*/
config.constants = {
// The alphabet
'alphabet': ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'],
// Search API's
'engines': {
'aquabrowser': {
'timeout': 5000,
'uri': 'http://search.lib.cam.ac.uk/result.ashx',
'uri_availability': 'http://search.lib.cam.ac.uk/availability.ashx',
'uri_facets': 'http://search.lib.cam.ac.uk/RefinePanel.ashx',
'uri_suggestions': 'http://search.lib.cam.ac.uk/AquaServer.ashx'
},
'summon': {
'timeout': 10000,
'uri': 'api.summon.serialssolutions.com',
'version': '/2.0.0/search'
}
},
// Available formats (search)
'formats': {
// Formats that are displayed in the search dropdown
'Book': {
'displayInSearch': true,
'displayName': 'Books',
'aquabrowser': 'Book',
'summon': 'Book'
},
'EBook': {
'displayInSearch': true,
'displayName': 'EBooks',
'aquabrowser': 'EBook',
'summon': 'eBook'
},
'Ejournal': {
'displayInSearch': true,
'displayName': 'Ejournals',
'aquabrowser': 'Ejournal',
'summon': 'Ejournal'
},
'Manuscript': {
'displayInSearch': true,
'aquabrowser': 'Manuscript',
'summon': 'Manuscript'
},
'Journal': {
'displayInSearch': true,
'aquabrowser': 'Journal',
'summon': 'Journal Article'
},
'Paper': {
'displayInSearch': true,
'aquabrowser': 'Paper',
'summon': 'Paper'
}
}
};
/**
* `config.nodes`
*/
config.nodes = {
// Home
'home': {
'title': 'Home',
'link': '',
'inNavigation': true,
'settings': {
'twitter': {
'timeout': 4000,
'tweet_expiration': 900000
}
}
},
// Find a resource
'find-a-resource': {
'title': 'Find a resource',
'link': 'find-a-resource',
'inNavigation': true,
'settings': {
'minTagValue': 10,
'numberOfHoldingsShown': 3,
'pageLimit': 40,
'parameters': ['api', 'contenttype', 'facet', 'id', 'language', 'page', 'q', 'ref', 'subjectterms']
}
},
// Find a library
'find-a-library': {
'title': 'Find a library',
'link': 'find-a-library',
'inNavigation': true,
'settings': {
'ranges': [
{'value': 0.25, 'label': 'Within 1/4 mile'},
{'value': 0.5, 'label': 'Within 1/2 mile'},
{'value': 1, 'label': 'Within 1 mile'},
{'value': 2, 'label': 'Within 2 miles'}
]
}
},
// Using our libraries
'using-our-libraries': {
'title': 'Using our libraries',
'link': 'using-our-libraries',
'inNavigation': true,
'settings': {}
},
// My account
'my-account': {
'title': 'My account',
'link': 'my-account',
'inNavigation': true,
'settings': {}
},
// Library blogs
'blogs': {
'title': 'Blogs',
'link': 'blogs',
'inNavigation': false,
'settings': {
'expiration': 900000,
'itemsPerPage': 10,
'url': 'http://mix.chimpfeedr.com/1dc9c-cam-blogs-01Nov13'
}
}
};