-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandler.js
More file actions
32 lines (29 loc) · 741 Bytes
/
handler.js
File metadata and controls
32 lines (29 loc) · 741 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
26
27
28
29
30
31
32
'use strict';
module.exports.hello = async event => {
console.log(event.pathParameters.name)
const reply = `Hello there... ${event.pathParameters.name}`;
// const {first, second} = event;
// const added = first + second;
return {
statusCode: 200,
body: JSON.stringify(
{
message: reply,
},
null,
2
),
};
// Use this code if you don't use the http event with the LAMBDA-PROXY integration
// return { message: 'Go Serverless v1.0! Your function executed successfully!', event };
};
module.exports.cron = async event =>{
const now = new Date();
const message = `Time is ${now}`;
console.log(message);
return {
body: JSON.stringify({
message: message,
})
}
}