Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Question for loading index.html + subdirrectories #541

Open
@Jean-PhilippeDESCAMPS

Description

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /