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

Files not being served from rewrite rule after setting a SPA and root directory #45

Closed
huystuhh opened this issue Jul 27, 2016 · 1 comment
Labels

Comments

@huystuhh
Copy link

Hi, I'm having an issue getting a rewrite rule to successfully serve files after setting a new root directory as a SPA. Basically, my folder directory is similar to this:

  • Project
    • app
      • index.html
    • node_modules
    • bower_components

Essentially, I'm launching the ws from the project root, setting app as the new root directory, setting index.html as the starting point for the SPA flag, and then trying to serve the bower_components folder to the app.

This is my launch command:
ws -d app --spa index.html -r '/bower_components/* -> ../bower_components/$1'

I'm getting a 403 error in terminal whenever the server tries to access the files. So I believe it's finding the folder, but can't serve it up. I've tried modifying the folder permissions with no success so far. Is there a way to do this currently? I might just be missing something completely. Any assistance would be greatly appreciated! Thanks!

@75lb
Copy link
Member

75lb commented Jul 27, 2016

Hi! Files outside of the root directory will not be served (for security reasons). If you set --directory to /app, then only files inside /app can be served. A rewrite can not help you here.

Your bower_components folder needs to be inside the root folder, so either serve the root project folder or move bower_components into /app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants