-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandler.js
More file actions
46 lines (42 loc) · 713 Bytes
/
handler.js
File metadata and controls
46 lines (42 loc) · 713 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"use strict";
const querystring = require("querystring");
module.exports.hello = async (event) => {
return {
statusCode: 200,
body: JSON.stringify(
{
message: "¡Hola Serverless!",
input: event,
},
null,
2
),
};
};
module.exports.helloUser = async (event) => {
return {
statusCode: 200,
body: JSON.stringify(
{
message: `Hola ${event.pathParameters.name}`,
input: event,
},
null,
2
),
};
};
module.exports.createUser = async (event) => {
const body = querystring.parse(event["body"]);
return {
statusCode: 200,
body: JSON.stringify(
{
message: "Petición para crear usuario",
input: `Hola ${body.user}`,
},
null,
2
),
};
};