swifter icon indicating copy to clipboard operation
swifter copied to clipboard

how can shareFilesFromDirectory support files in subdirectory?

Open zhouhesheng opened this issue 2 years ago • 3 comments

    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?

zhouhesheng avatar Mar 04 '22 06:03 zhouhesheng

Did you find a way to solve this?

vnsamy-code avatar Jun 23 '22 08:06 vnsamy-code

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?

vnsamy-code avatar Jun 27 '22 13:06 vnsamy-code

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

dzy1997 avatar Jan 24 '24 12:01 dzy1997