forked from sanfrancesco/prerendercloud-lambda-edge
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvalidate.js
More file actions
26 lines (22 loc) · 664 Bytes
/
validate.js
File metadata and controls
26 lines (22 loc) · 664 Bytes
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
function monkeyPatchPrerenderCloud(lib, options) {
const origSet = lib.set;
lib.set = function(key, val) {
options[key] = val;
origSet.apply(undefined, arguments);
};
}
const prerendercloud = require("prerendercloud");
const options = {};
monkeyPatchPrerenderCloud(prerendercloud, options);
const handler = require("./handler");
handler.resetPrerenderCloud();
if (!options["host"]) {
throw new Error(
"host was not set, edit handler.js and set host to your CloudFront distribution URL or aliased domain"
);
}
if (!options["prerenderToken"]) {
console.log(
"warning, prerenderToken was not set, requests will be rate limited"
);
}