cirospaciari / socketify.py

Bringing Http/Https and WebSockets High Performance servers for PyPy3 and Python3
https://www.socketify.dev
MIT License
1.39k stars 50 forks source link

Can we add if __name__ == "__main__": guards to the hello world examples and the documentation examples? #168

Closed leunga1000 closed 5 months ago

leunga1000 commented 6 months ago

Is your feature request related to a problem? Please describe. Hey, thanks for making socketify.py

Got a little bit confused between running the app in the code and via the cli.

Started with the hello world, trying to set the host and port (admittedly don't need to do this much), then tried to run that code with the cli interface. It ran but ignored the options - it was running the application code when importing the module in load_module and stopping there.

Describe the solution you'd like

Additional context Don't mind to do this if you don't have time.