Are routes not loaded when executing a command? e.g. Drive.getUrl(...) #3880
Answered
by
thetutlage
mattkenefick
asked this question in
Help
-
I'm executing a command with It cannot find the Did I forget to config something? |
Beta Was this translation helpful? Give feedback.
Answered by
thetutlage
Aug 24, 2022
Replies: 1 comment 1 reply
-
You need to commit routes to the store before using them inside a command. The following as the first statement in the command this.application.container.use('Adonis/Core/Route').commit()
// Now use drive |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mattkenefick
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to commit routes to the store before using them inside a command. The following as the first statement in the command
run
method should do the job.