Giter Club home page Giter Club logo

Comments (8)

harrytruong avatar harrytruong commented on July 24, 2024

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

from live-server.

ludohenin avatar ludohenin commented on July 24, 2024

@harrytruong this is exactly it.

from live-server.

tapio avatar tapio commented on July 24, 2024

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

from live-server.

ludohenin avatar ludohenin commented on July 24, 2024

Looks good. I think you can merge that one.

from live-server.

heminm avatar heminm commented on July 24, 2024

Please merge. This would be a great feature.

from live-server.

tapio avatar tapio commented on July 24, 2024

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.

from live-server.

tapio avatar tapio commented on July 24, 2024

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

from live-server.

efc avatar efc commented on July 24, 2024

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.

from live-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.