I am fairly new to node and using express with it.
I have a simple API which gets data from mongo in this way:
- From a
Router
I call a async method inAccountServices
(which is in a different file) calledgetAccountDetails
getAccountDetails
in turn gets data from mongo making an async call.- I don't want to pass
req
,res
objects to thegetAccountDetails
function, So I've useasync
await
and it works perfectly.
What I want to understand is does my whole thread/api goes into wait state for that async
await
function to resolve?
If So, how can I overcome this.