How can I wait for my "request" and response back to front end? #1650
-
Hi guys, I am working on the Zoom API now. I want to send my token from ZOOM API to front-end as a response. However, "token from request" is always printed first and undefined! Then the token from Zoon API" will be followed with the token. How can I make it happend? Thx! ` class ZoomController {
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @YuyangZhou3! 👋 Your issue is not related to AdonisJS at all. To give you a hint, you are mixing |
Beta Was this translation helpful? Give feedback.
Hey @YuyangZhou3! 👋
Your issue is not related to AdonisJS at all.
You need first to understand how asynchronous code works in JavaScript.
To give you a hint, you are mixing
async/await
with a callback API.I'd recommend you to read about Promise and
async/await
.