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

Open browser with URL #231

Closed
jamiewinder opened this issue Jan 8, 2016 · 15 comments · May be fixed by bangerkuwranger/http-server#1
Closed

Open browser with URL #231

jamiewinder opened this issue Jan 8, 2016 · 15 comments · May be fixed by bangerkuwranger/http-server#1

Comments

@jamiewinder
Copy link

The -o option is really handy, but unless I'm missing something I can't ask for anything other than the root to be opened? It'd be handy if we could specific a relative path, e.g.

http-server -o /pages/index.html

Opens browser with http://localhost:8080/pages/index.html

@SimplGy
Copy link

SimplGy commented Jan 21, 2016

This would be handy for me. Looks like pretty isolated changes.

@lski
Copy link

lski commented Mar 17, 2016

I create a pull request #260 that allows for using both a relative path and still allow for using an absolute path in the same way as before.

I think its a none breaking change as paths starting with a '/' didnt do anything anyway and will still allow anybodies pre-existing scripts to run :) plus its handy to be able to use an absolute url at times as well.

The only stipulation is the relative path must start with a forward slash '/'.

@craigmichaelmartin
Copy link

Related to issue #197. PR #250 addresses this directly, and #234, #260 add work arounds. If they could be reviewed, that would be great :)

@allenhwkim
Copy link

+1

@soyiatgit
Copy link

I am unbale to open my index.html page using any of following commannd

-o index
-o index.html
-o 'index.html'
-o '/index.html'

Am i misisng on something..I npm installed http-server today itself so believe to have the above change. The browser for me still opens at localhost:8080

@pmunin
Copy link

pmunin commented Aug 11, 2017

any updates on this issue?

@dominique-mueller
Copy link

Any news on this? Really seems like a useful feature to have!

@appurist
Copy link

appurist commented Dec 15, 2017

I don't understand what the path part of -o [path] was supposed to do it if did not behave this way. At least one of the four combinations above should be working. I find that (at least on my Linux installation) that it only launches the browser (at all) if I do not specify the path after -o at all.

Any progress on this issue? I'd love to specify a location and a file, or have the root location be implicit in the file, e.g.:
http-server site1 -o test1.html
or
http-server -o site1/test1.html

@damianobarbati
Copy link

any news on this?=

@alistair-hmh
Copy link

alistair-hmh commented Feb 27, 2019

Nothing opens for me at all with the -o flag.

@craigmichaelmartin
Copy link

There were a few PRs open to address this. It looks like #250 was @thornjad chosen solution, and is waiting to be merged.

@thornjad
Copy link
Member

#250 should be the one, I have a giant merge train in the works to get things moving.

@slavafomin
Copy link

I'm having the same problem. The -o option doesn't do anything on Ubuntu 18.04.2 LTS.

@LarryBattle

This comment has been minimized.

@thornjad
Copy link
Member

This is working for me in version 0.12.3, please re-open if further problems are found

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

Successfully merging a pull request may close this issue.