Comments (8)
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:
-
With this example file structure:
root |-- foo | |-- apple |-- bar | |-- banana | |-- orange
-
And running
live-server
from root:$ live-server --base=alias
-
Should results in requests matching:
GET /foo/apple
=404 Not Found
GET /alias/foo/apple
=200
loadingfoo/apple
GET /alias/bar/banana
=200
loadingbar/banana
GET /bar/banana
=404 Not Found
from live-server.
@harrytruong this is exactly it.
from live-server.
WIP at branch base-url. Feel free to test it from there.
from live-server.
Looks good. I think you can merge that one.
from live-server.
Please merge. This would be a great feature.
from live-server.
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.
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.
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)
- Prevent script injection in an iframe HOT 1
- liveReload no work in WSL2
- Does not load at all
- Live-server links to local files do not work HOT 6
- https not working properly
- How can I get live-server to work with URLs that are prepended with a base URL during production builds?
- Consider moving to esm and then build for cjs HOT 2
- Install anguar app but when refresh its coming 404 error, route not working
- 'live-server' is not recognized as the name
- Should entry file flag take precedence over the index file?
- On mac, installed live-server but the main script has CRLF line terminators HOT 2
- live-server watching .git directory changes HOT 1
- live-server very slow for some reason (like 3G network) HOT 1
- Browser doesn't refresh if script tag is added
- I can't install live-server! HOT 2
- No live reload on files with no <head> HOT 1
- liveserver issue
- Parameter Routes do not work with live-server
- Track a lock file please
- Brotli/GZip support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from live-server.