Created
October 12, 2018 05:09
-
-
Save mewben/10020ed59c0249bde74ea1774046c80e to your computer and use it in GitHub Desktop.
Revisions
-
mewben created this gist
Oct 12, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ const someFunction = async () => { try { // wait 5 sec before sending the response await new Promise(resolve => setTimeout(() => resolve(), 5000)); return res.json({response: 'here'}) } catch (error) { // return error } }