Skip to content

Commit 6359187

Browse files
authored
Update handler.js
Signed-off-by: Jonathan <111000657+MrGuato@users.noreply.github.com>
1 parent 2ca3c5c commit 6359187

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

backend/starwars-api/handler.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
const facts = require("./starwarsFacts");
22

3-
MediaSourceHandle.exports.starwarsfact = async (event) => {
4-
const randomFact = facts[Math.floor(Math.random() * facts.length)];
5-
return {
6-
statsCode: 200,
7-
headers: {
8-
"Content-Type": "application/json",
9-
"Access-Control-Allow-Origin": "https://cloud.mrcyberleon.org"
10-
},
11-
body: JSON.stringify({ fact: randomFact })
12-
};
13-
};
3+
module.exports.starwarsfact = async (event) => {
4+
const randomFact = facts[Math.floor(Math.random() * facts.length)];
5+
6+
return {
7+
statusCode: 200,
8+
headers: {
9+
"Content-Type": "application/json",
10+
"Access-Control-Allow-Origin": "https://cloud.mrcyberleon.org"
11+
},
12+
body: JSON.stringify({ fact: randomFact })
13+
};
14+
};

0 commit comments

Comments
 (0)