socketify.py/examples/automatic_port_selection.py

6 wiersze
222 B
Python

from socketify import App
app = App()
app.get("/", lambda res, req: res.end("Hello World socketify from Python!"))
app.listen(0, lambda config: print("Listening on port http://localhost:%d now\n" % config.port))
app.run()