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

request an "-o" option on "datasette server" to open the default browser at the running url #970

Closed
secretGeek opened this issue Sep 20, 2020 · 4 comments

Comments

@secretGeek
Copy link

secretGeek commented Sep 20, 2020

This is a request for a "convenience" feature, and only a nice to have. It's based on seeing this feature in several little command line hypertext server apps.

If you run, for example:

datasette.exe serve --open "mydb.s3db" 

I would like it if default browser is launched, at the URL that is being served.

The angular cli does this, for example

ng serve --open #see https://angular.io/cli/serve

...as does my usual mini web server of choice when inspecting local static files....

npx http-server -o # see https://www.npmjs.com/package/http-server

Just a tiny thing. Love your work!

@simonw
Copy link
Owner

simonw commented Sep 21, 2020

I like this. It could work with the --root option too and automatically sign you in as the root user.

@simonw
Copy link
Owner

simonw commented Sep 21, 2020

The Python standard library has a module for this: https://docs.python.org/3/library/webbrowser.html

@secretGeek
Copy link
Author

secretGeek commented Sep 23, 2020

Oh wow oh wow. Thanks so much Simon. In an astoundingly rough week, this is a shining jewel. 🤣

@simonw
Copy link
Owner

simonw commented Sep 24, 2020

Idea: if a database only has a single table, this could open straight to /db/table. If it has multiple tables but a single database it could open straight to /db.

simonw added a commit that referenced this issue Oct 1, 2020
@simonw simonw added this to the Datasette 0.50 milestone Oct 8, 2020
simonw added a commit that referenced this issue Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants