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

Add a detached mode #56

Open
rasbt opened this issue Apr 22, 2024 · 4 comments
Open

Add a detached mode #56

rasbt opened this issue Apr 22, 2024 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rasbt
Copy link
Collaborator

rasbt commented Apr 22, 2024

🚀 Feature

It would be nice to add a --detach mode similar to jekyll serve to detach the session.

Motivation

This could be useful for testing purposes and usability etc so it doesn't block the main terminal.

Pitch

The equivalent of

jekyll serve --detach
...
      Generating... 
                    done in 3.982 seconds.
 Auto-regeneration: disabled when running server detached.
    Server address: http://127.0.0.1:4000/
Server detached with pid '76023'. Run `pkill -f jekyll' or `kill -9 76023' to stop the server.

Alternatives

Additional context

@rasbt rasbt added enhancement New feature or request help wanted Extra attention is needed labels Apr 22, 2024
Copy link

Hi! thanks for your contribution!, great first issue!

@williamFalcon
Copy link
Contributor

williamFalcon commented May 25, 2024

this would require introducing a CLI which may not be a bad idea but idk if it’s needed? we all want to keep litserve simple but maybe CLI can still keep it simple

@andyland
Copy link
Contributor

andyland commented Jul 2, 2024

You can just put an ampersand at the end to achieve the same thing

~ python server.py &
[1] 6372

@aniketmaurya
Copy link
Collaborator

that's right! as Andy said you can put ampersand for this. But to terminate the server you either have to note down the process id and kill that or find it later and kill it. Which might be intimidating for some users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants