[GH-ISSUE #37] [Suggestion] Web static directory support #15

Closed
opened 2026-04-08 16:49:48 +03:00 by zhus · 3 comments
Owner

Originally created by @FirTech on GitHub (Jun 12, 2022).
Original GitHub issue: https://github.com/sigoden/dufs/issues/37

I tried to write a web page suitable for "duf" by myself. The main layout was referenced from h5ai, and it was packaged with Webpack, but the packaged pictures were scattered. Can Web Static Directory Support be Added? When the browser requests any file, it requests the files in the "assets" directory.

Originally created by @FirTech on GitHub (Jun 12, 2022). Original GitHub issue: https://github.com/sigoden/dufs/issues/37 I tried to write a web page suitable for "duf" by myself. The main layout was referenced from [h5ai](https://larsjung.de/h5ai/), and it was packaged with Webpack, but the packaged pictures were scattered. Can Web Static Directory Support be Added? When the browser requests any file, it requests the files in the "assets" directory.
zhus closed this issue 2026-04-08 16:49:48 +03:00
Author
Owner

@sigoden commented on GitHub (Jun 12, 2022):

duf can serve static files.

I do not quite understand what you mean。

If your assets contains img1.png

run duf assets, access it with http://localhost:5000/img1.png
run duf assets --path-prefix assets, access it with http://localhost:5000/assets/img1.png

<!-- gh-comment-id:1153040205 --> @sigoden commented on GitHub (Jun 12, 2022): duf can serve static files. I do not quite understand what you mean。 If your assets contains `img1.png` run `duf assets`, access it with `http://localhost:5000/img1.png` run `duf assets --path-prefix assets`, access it with `http://localhost:5000/assets/img1.png`
Author
Owner

@FirTech commented on GitHub (Jun 12, 2022):

For example, store "duf-src\assets\img1.png" in the "assets" directory of the "duf" source code, then you can access http://localhost:5000/img1.png

<!-- gh-comment-id:1153070226 --> @FirTech commented on GitHub (Jun 12, 2022): For example, store "duf-src\assets\img1.png" in the "assets" directory of the "duf" source code, then you can access http://localhost:5000/img1.png
Author
Owner

@FirTech commented on GitHub (Jun 12, 2022):

Oh, I got it, I just need to convert all the images to base64 and package them in the index.html file, disturb you.

<!-- gh-comment-id:1153070243 --> @FirTech commented on GitHub (Jun 12, 2022): Oh, I got it, I just need to convert all the images to base64 and package them in the index.html file, disturb you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#15