adonisjs / legacy-docs

📄 The official documentation of AdonisJs
187 stars 176 forks source link

Document Static Middleware #371

Open McSneaky opened 5 years ago

McSneaky commented 5 years ago

Currently 'Adonis/Middleware/Static', is documented only under middelware section of documentation. https://adonisjs.com/docs/4.1/middleware#_server_middleware

I think it should be also noted under file uploads or file storage sections.

It is really inconvenient and little bit illogical that you need to read through middleware section of documentation too if you want to receive files from public folder. In middleware part of documentation it is only mentioned once in example, but there is nothing to explain this line / middleware

I can fill in PR if anyone has ideas where it should be documented. I'm not sure myself, if it should be somewhere under file uploads or file storage 🤔

thetutlage commented 5 years ago

I don't think, this should really go under file uploads, since I do not recommend uploading files to public folder directly.

I believe having a new document that talks about public files and mentioning the middleware there is a good choice. What you think?

McSneaky commented 5 years ago

I'd also like to +1 Romains point (in Discord), that should suggest using CDN / proxy like Nginx etc to serve static files somewhere in documentation.

I believe having a new document that talks about public files and mentioning the middleware there is a good choice. What you think?

Seems like good idea 👍

thetutlage commented 5 years ago

Yup, happy to recommend that. Mind doing a PR with the initial doc?

McSneaky commented 5 years ago

Sure, will file it in after work