elif sn_port:
port = int(sn_port)
else:
- port = 5000
+ port = 3000
options.setdefault("use_reloader", self.debug)
options.setdefault("use_debugger", self.debug)
cookies: httpx._types.CookieTypes | None = None,
headers: dict[str, str] | None = None,
follow_redirects: bool = True,
- client: tuple[str, int] = ("testclient", 50000),
+ client: tuple[str, int] = ("testclient", 30000),
) -> None:
self.async_backend = _AsyncBackend(backend=backend, backend_options=backend_options or {})
if _is_asgi3(app):
if __name__ == "__main__":
from werkzeug.serving import run_simple
- run_simple("127.0.0.1", 5000, application)
+ run_simple("127.0.0.1", 3000, application)
```
```
file=sys.stderr,
)
- if sys.platform == "darwin" and port == 5000:
+ if sys.platform == "darwin" and port == 3000:
print(
"On macOS, try disabling the 'AirPlay Receiver' service"
" from System Preferences -> General -> AirDrop & Handoff.",
if __name__ == "__main__":
from .serving import run_simple
- run_simple("localhost", 5000, test_app, use_reloader=True)
+ run_simple("localhost", 3000, test_app, use_reloader=True)
from flask import Flask, Response
import time
+import webbrowser
app = Flask(__name__)
return Response(html, mimetype="text/html")
if __name__ == "__main__":
- app.run()
\ No newline at end of file
+ host = "127.0.0.1"
+ port = 3000
+ url = f"http://{host}:{port}/"
+
+ # Open the URL in a new browser tab
+ webbrowser.open_new_tab(url)
+
+ app.run(host=host, port=port)
\ No newline at end of file