http-server
http-server copied to clipboard
Add baseDir option, add -b flag to cli options to specify base path
node-ecstatic allows for a baseDir
option, which I was looking to use with this lib.
This PR adds the following:
- a
baseDir
option to the main lib file - a
-b
flag to the cli tool - a
path
variable to printed/opened URLs - CLI and README docs for baseDir and flag
- tests for new baseDir option
Fixes #139
+1, would this feature be merged?
+1 Looking for this feature as well.
Rebased in case this becomes mergeable - @indexzero LMK if I should keep this branch in sync or if we should close this PR, thanks!
This is the same as #395 - hope the feature is available soon.
+1
This needs rebasing on top of the latest from master
, but I generally prefer it (because tests, etc) to what's in #395.
If someone wants to get this up to speed with the latest from master, I'm 👍 on merging it.
All set. Noticed the paths weren't printing to the logs, so I added that too.
Hrm... -b
conflicts with #463. @thornjad we should be careful about our shorthand choices probably... #395 also used -b
. Thinking baseDir
setting will be more frequently used, so maybe we use -b
here, and remove the alias from #463.
@BigBlueHat yeah that makes sense, 'b' is a popular letter. Brotli can be --brotli
only
Alright, @idmontie's #395 and @jesseditson's #294 have a one-line difference. I'm going to go with #294 because it came first
I'll fix this up tonight (PST) and rebase against master!
Ok I think this is up to date, LMK if there's anything else needed on my end!
Would it be possible to split the change into
- introduce feature and --base-dir flag in a 12.x minor version
- default -b from --brotli to --base-dir in 13.x
The implementation seams ready and the functionality is requested ( see #139 ) since years. My use case is SPA with client side routing in 404.html on github pages. It would love to clean up my code ( dev mode work around ) as soon as this is available.
Is this PR going to be merged any time soon? Would love to be able to use this functionality.
Oh, please, is there any way one can help to get this merged?
Requirements for merging:
- [ ] Add documentation to
doc/http-server.1
- [x] Wait for #693 to merge (because it will likely cause conflicts)
- [ ] Fix all conflicts
This has long fallen off of my radar (I filed this PR 5 years ago and no longer have a dependency on this lib), happy to fix conflicts if a different interested party wants to get the docs going.
Is this still an open feature?
I was trying to implement http-server
with a base path but the -b
flag is used for brotli now...
@thornjad @jesseditson As this PR is 6 years old and (as one might expect) has gone stale, I rebased, fixed merge conflicts and made a new PR here: https://github.com/http-party/http-server/pull/837
@thornjad @jesseditson As this PR is 6 years old and (as one might expect) has gone stale, I rebased, fixed merge conflicts and made a new PR here: #837
Can this be merged? We do need this feature. Thanks!