So I have (so far) 2 projects with AdonisJS (Thank you for this framework by the way, it may have been one of the best things I discovered this year), one is done, and the other is just started, but I use the first one to easily remember how I managed to solve a problem I would encounter.
I need to upload several files, and while I had no problem whatsoever with the first project, I can upload anything on the second one, it will get saved in the public directory... but I can't get to reach them, AdonisJS will return me the following:
HttpException
E_ROUTE_NOT_FOUND: Route not found GET /settings/landing.jpeg
All the files are CHMOD 755 and the the CHOWN is the same everywhere, even for the files, so I don't think it's a permission issue.
Adonis version 4.10
NPM version 6.5.0
Node version 10.13
Hey @Drillan767! 馃憢
Please, ensure that you have the StaticFileMiddleware enabled in your start/kernel.js file.
Thank you for your answer, that's weird because I didn't enabled it in my "old" project, yet I had no trouble reaching my files in the "public" directory.
What would the syntax to enable it in the kernel.js file?
Thank you in advance
My bad, I found the following line
'Adonis/Middleware/Static',
Being commented out, and I do remember uncommenting it on my old project, and now it works, thank you!
I ran into the same issues but none of the solutions above works
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hey @Drillan767! 馃憢
Please, ensure that you have the
StaticFileMiddlewareenabled in yourstart/kernel.jsfile.