-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Static File Handler #674
Added Static File Handler #674
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing the changes I suggested
Let me know if any changes can be done to accommodate more functionality. |
@KedarisettiSreeVamsi Thankyou for your contribution. You can add it in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo
@KedarisettiSreeVamsi please add unit tests for the feature you've implemented! |
Hi @vipul-rawat, |
I am pretty new to this so was the reason I am asking this question. |
@KedarisettiSreeVamsi I think we can create a tmp folder and when cleaning up we can remove all the tmp files created! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Can someone resolve the conflict of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Remove helper and constant files. (fixed)
- Lot of lines are not covered (coverage is not 100% for the newly added code)
- ExcludeFiles need to be unexported (we can move the code to add openapi.json in the router itself) (fixed)
- FileDirectory needs to be renamed, doesn't seem right
- ExcludeExtensions, HideDotFiles can be removed for now, I dont find a valid usecase. (IMO user can just not keep that file if they dont want it to be rendered) (fixed)
- DirectoryListing can be renamed to ListDirectories or ListDirectoryFiles
- A lot of functions/methods are being exported which can be unexported (fixed)
- .env Config STATIC_DIRECTORY_LISTING can be removed (fixed)
Seem safer and avoid potential breaking changes 👍 |
Added Static File Handling
If a public directory is found then it will create a public endpoint by default
If we want to added any other folders can use AddStaticFiles endpoint and then if endpoint and directory is provided then it will check whether the particular endpoint is available otherwise throws an error
Closes: #502.