-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.mjs
26 lines (24 loc) · 813 Bytes
/
index.mjs
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
export const handler = async (event) => {
console.log("scheduled lambda function called.")
// warmup calls do not have event.pathParameters defined
if (!event.pathParameters) {
console.log('warmup call detected, ending');
return;
}
return new Promise((resolve) => {
const message = "This is the response to an unscheduled HTTP request";
console.warn(message);
resolve({
"isBase64Encoded": false,
"statusCode": 200,
"headers": {
'Access-Control-Allow-Origin': process.env.CORS_ORIGIN,
'Access-Control-Allow-Credentials': true,
},
"body": JSON.stringify({
"success": true,
"message": message
})
});
});
}