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

Question for loading index.html + subdirrectories #541

Open
Jean-PhilippeDESCAMPS opened this issue Sep 6, 2023 · 1 comment
Open

Question for loading index.html + subdirrectories #541

Jean-PhilippeDESCAMPS opened this issue Sep 6, 2023 · 1 comment

Comments

@Jean-PhilippeDESCAMPS
Copy link

Jean-PhilippeDESCAMPS commented Sep 6, 2023

Hello 👋

Im trying to make an app that embed web app code.
I have added in my project source 2 folders:

  • One for the app
  • One for the authentication process

Im trying to start a server to execute my authentication app first.
let server = HttpServer() do { try server.start() let bundlePath = Bundle.main.bundlePath var frontEndAuthPath = bundlePath frontEndAuthPath.append("/frontend-auth/") server["/auth"] = shareFilesFromDirectory(frontEndAuthPath) server["/auth/static/"] = shareFilesFromDirectory(frontEndAuthPath.appending("static/")) server["/auth/static/js"] = shareFilesFromDirectory(frontEndAuthPath.appending("static/js")) server["/auth/static/css"] = shareFilesFromDirectory(frontEndAuthPath.appending("static/css")) server["/auth/static/media"] = shareFilesFromDirectory(frontEndAuthPath.appending("static/media")) print("Server has started ( port = \(try server.port()) ). Try to connect now...") } catch (let error) { print(error.localizedDescription) }

My problem is that the web app is not started because it not found static/js/files

I saw different methods : shareFilesFromDirectory or directoryBrowser.

How can I run correctly my server ?

@zsinba
Copy link

zsinba commented Nov 30, 2023

same issue

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

2 participants