forked from holin/docker-prerender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
33 lines (25 loc) · 886 Bytes
/
server.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
var prerender = require('prerender');
var server = prerender({
workers: process.env.PHANTOM_CLUSTER_NUM_WORKERS,
iterations: process.env.PHANTOM_WORKER_ITERATIONS || 10,
phantomBasePort: process.env.PHANTOM_CLUSTER_BASE_PORT || 12300,
phantomArguments: {
'--load-images': false,
'--ignore-ssl-errors': true,
'--ssl-protocol': 'tlsv1',
'--disk-cache': true
},
messageTimeout: process.env.PHANTOM_CLUSTER_MESSAGE_TIMEOUT
});
server.use(prerender.removeScriptTags());
if (process.env.BASIC_AUTH_USERNAME) {
server.use(prerender.basicAuth());
}
server.use(prerender.inMemoryHtmlCache());
// Log errors to console
server.use(prerender.logger());
//server.use(prerender.blacklist());
//server.use(prerender.httpHeaders());
// server.use(prerender.s3HtmlCache());
// server.use(require('my-plugin'));
server.start();