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

Serve from a base url #37

Closed
ludohenin opened this issue May 10, 2015 · 8 comments
Closed

Serve from a base url #37

ludohenin opened this issue May 10, 2015 · 8 comments

Comments

@ludohenin
Copy link

It would be nice (unless I missed something) to be able to serve files from a base url.
I'm working with a remote server and I'm targeting for example my-domain.com/base (proxied to my live-server) but I'm (obviously) getting Cannot GET /base.

@harrytruong
Copy link
Contributor

Not sure what you're looking for, but would it be possible to just create a /base folder, and have live-server running from one directory higher? It would be the simplest fix.

Otherwise, when you say "serve from base url" do you mean like:

  1. With this example file structure:

    root
    |-- foo
    |    |-- apple
    |-- bar
    |    |-- banana
    |    |-- orange
    
  2. And running live-server from root:

    $ live-server --base=alias
  3. Should results in requests matching:

    • GET /foo/apple = 404 Not Found
    • GET /alias/foo/apple = 200 loading foo/apple
    • GET /alias/bar/banana = 200 loading bar/banana
    • GET /bar/banana = 404 Not Found

@ludohenin
Copy link
Author

@harrytruong this is exactly it.

@tapio
Copy link
Owner

tapio commented Aug 24, 2015

WIP at branch base-url. Feel free to test it from there.

@ludohenin
Copy link
Author

Looks good. I think you can merge that one.

@heminm
Copy link

heminm commented Dec 5, 2015

Please merge. This would be a great feature.

@tapio
Copy link
Owner

tapio commented Dec 6, 2015

Master now has a new option --mount=ROUTE:PATH - serve the paths contents under the defined route (multiple definitions possible) which should be useful for this use case also.

@tapio
Copy link
Owner

tapio commented Jan 21, 2016

I'm going to close this now, but feel free to reopen/complain if --mount=ROUTE:PATH param does not do it for you.

@efc
Copy link

efc commented Dec 1, 2018

I am confused about how the --mount option actually resolves the request for a --base option. The --base option would apply to the whole site universally. Can someone describe how to use the --mount option to do the same? I don't see any documentation of acceptable routes or how to create a wildcard route that applies to the whole site.

BTW, I opened another issue about this before realizing that this one could be reopened. Apologies for not knowing what is the correct process.

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

5 participants