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

how can shareFilesFromDirectory support files in subdirectory? #516

Open
zhouhesheng opened this issue Mar 4, 2022 · 3 comments
Open

how can shareFilesFromDirectory support files in subdirectory? #516

zhouhesheng opened this issue Mar 4, 2022 · 3 comments

Comments

@zhouhesheng
Copy link

    let docsPath = Bundle.main.resourcePath! + "/dist.bundle"
    server["/:path"] = shareFilesFromDirectory(docsPath, defaults: ["index.html"])
    try! server.start(13001)

test:
curl http://127.0.0.1:13001/index.html working
curl http://127.0.0.1:13001/ not working, but is this suppose to load the index.html in the directory?
curl http://127.0.0.1:13001/_next/static/chunks/framework-xx.js all not woking?

How can I make files in subdirectorys work?

@vnsamy-code
Copy link

Did you find a way to solve this?

@vnsamy-code
Copy link

Hi @damian-kolakowski - I am trying to find a solution for this.

While this works in the simulator on a device running iOS 15.4 this is not working; only the index.html page is loaded but not the rest of the contents in the directory.

Do you have any thoughts on this, please?

@dzy1997
Copy link

dzy1997 commented Jan 24, 2024

Got the same problem here, if the path contains any subdirectories, the registered handler "shareFilesFromDirectory" won't be invoked at all.

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

No branches or pull requests

3 participants