From 1af5c0702a35a2dcf1b3d64ff2f1d742d3d7f9f5 Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Wed, 23 Feb 2022 08:23:47 -0800 Subject: [PATCH] fix (#2): add async keyword --- netlify/functions/joke.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify/functions/joke.js b/netlify/functions/joke.js index 5ef6d1b..a07759a 100644 --- a/netlify/functions/joke.js +++ b/netlify/functions/joke.js @@ -1,7 +1,7 @@ // Jokes provided from the lovely folks at https://icanhazdadjoke.com import jokes from './jokes.json' -export const handler = (event) => { +export const handler = async () => { // Generates a random index based on the length of the jokes array const randomIndex = Math.floor(Math.random() * jokes.length) const randomJoke = jokes[randomIndex]