Skip to content
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

Add support to fs.fs on serve static files #1640

Conversation

peczenyj
Copy link
Contributor

@peczenyj peczenyj commented Nov 2, 2023

this is the following patch

https://patch-diff.githubusercontent.com/raw/valyala/fasthttp/pull/1374.patch

from pr #1374

however with smaller differences, lets continue this development?

should fix #974

@erikdubbelboer erikdubbelboer merged commit 4010b16 into valyala:master Nov 5, 2023
14 checks passed
@erikdubbelboer
Copy link
Collaborator

Thanks! And also thanks to @Aoang!

@efectn
Copy link
Contributor

efectn commented Dec 3, 2023

Hi @peczenyj. What about using root as path prefix when fs.FS is used. For example i have a directory like and i read it with os.DirFS("./views"):

views
├── index.slim
├── layouts
│   └── main.slim
└── partials
    ├── footer.slim
    ├── header.slim
    └── meta.slim

By default, Fasthttp will accept views/ as root and we will be able to access all files. If i want to specify partials/ as root what should i do without changing os.DirFs parameters? Root property of FS struct doesn't seem to work for a case like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to serve embed.FS files
3 participants