How can i receive request (headers, host, absolute url) in my custom class (service)? #1745
Answered
by
thetutlage
sasha172017
asked this question in
Help
-
I need get request in custom class, how can i do to? does have adonis global request, i neet it NOT in controller? |
Beta Was this translation helpful? Give feedback.
Answered by
thetutlage
Oct 13, 2020
Replies: 1 comment 1 reply
-
There is no global request in AdonisJS and not possible in Node.js at all. You will have to pass it to the service constructor or the method you are calling |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
RomainLanz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no global request in AdonisJS and not possible in Node.js at all. You will have to pass it to the service constructor or the method you are calling