swifter
swifter copied to clipboard
html loading issue
I tried to load local html as follow:
let path = Bundle.main.resourcePath!
let server = HttpServer()
server["/:path"] = directoryBrowser(path)
do {
try server.start(9080, forceIPv4: true)
print("Server has started ( port = \(try server.port()) ). Try to connect now...")
} catch {
print("Server start error: \(error)")
}
When I visit http://localhost:9080/index.html, it shows some error as follow. The page loading is ok, but no content showing, maybe it's the problem with resource like css and js? And when I start a simple http server like 'python -m SimpleHTTPServer', it's working perfectly.
I am experiencing the same issue using shareFilesFromDirectory()