diff --git a/cista/__main__.py b/cista/__main__.py index c196cc1..65a00fe 100644 --- a/cista/__main__.py +++ b/cista/__main__.py @@ -57,7 +57,7 @@ Usage: Options: -c CONFDIR Custom config directory -l LISTEN-ADDR Listen on - :8000 (localhost port, plain http) + :8989 (localhost port, plain http) :3000 (bind another address, port) /path/to/unix.sock (unix socket) example.com (run on 80 and 443 with LetsEncrypt) @@ -80,7 +80,7 @@ Environment: first_time_help = """\ No config file found! Get started with: cista --user yourname --privileged # If you want user accounts - cista -l :8000 /path/to/files # Run the server on localhost:8000 + cista -l :8989 /path/to/files # Run the server on localhost:8989 See cista --help for other options! """ @@ -140,7 +140,7 @@ def _main(): if listen: settings["listen"] = listen elif not exists: - settings["listen"] = ":8000" + settings["listen"] = ":8989" config.update_config(settings) # Prepare to serve url, opts = serve.parse_listen(config.config.listen) @@ -186,7 +186,7 @@ def _user(args): # Defaults for new config when user is created operation = config.update_config( { - "listen": ":8000", + "listen": ":8989", "path": Path.home() / "Downloads", "public": False, } @@ -215,7 +215,7 @@ def _user(args): if operation == "created": sys.stderr.write( - "Now you can run the server:\n cista # defaults set: -l :8000 ~/Downloads\n" + "Now you can run the server:\n cista # defaults set: -l :8989 ~/Downloads\n" ) diff --git a/cista/serve.py b/cista/serve.py index 859a12f..c475e87 100644 --- a/cista/serve.py +++ b/cista/serve.py @@ -50,7 +50,7 @@ def parse_listen(listen): return f"https://{listen}", {"host": listen, "port": 443, "ssl": True} # Use fastapi_vue's parse_endpoint for everything else - endpoints = parse_endpoint(listen, default_port=8000) + endpoints = parse_endpoint(listen, default_port=8989) ep = endpoints[0] if "uds" in ep: @@ -64,5 +64,9 @@ def parse_listen(listen): host, port = ep["host"], ep["port"] # When binding all interfaces, use single_listener=False for Sanic if len(endpoints) > 1: - return f"http://localhost:{port}", {"host": host, "port": port, "single_listener": False} + return f"http://localhost:{port}", { + "host": host, + "port": port, + "single_listener": False, + } return f"http://{host}:{port}", {"host": host, "port": port} diff --git a/frontend/vite-plugin-fastapi.js b/frontend/vite-plugin-fastapi.js index 347c4c4..95e6d8a 100644 --- a/frontend/vite-plugin-fastapi.js +++ b/frontend/vite-plugin-fastapi.js @@ -6,10 +6,10 @@ * - Builds to the Python module's frontend-build directory * * Environment variables (with defaults): - * FASTAPI_VUE_BACKEND_URL=http://localhost:5180 - Backend API URL for proxying + * FASTAPI_VUE_BACKEND_URL=http://localhost:8999 - Backend API URL for proxying */ -const backendUrl = process.env.FASTAPI_VUE_BACKEND_URL || "http://localhost:5180" +const backendUrl = process.env.FASTAPI_VUE_BACKEND_URL || "http://localhost:8999" export default function fastapiVue({ paths = ["/api"] } = {}) { // Build proxy configuration for each path diff --git a/scripts/devserver.py b/scripts/devserver.py index 69666be..49930e7 100755 --- a/scripts/devserver.py +++ b/scripts/devserver.py @@ -5,8 +5,8 @@ Usage: uv run scripts/devserver.py [frontend] [--backend backend] Options: - frontend Vite frontend endpoint (default: localhost:5173) - --backend Cista backend endpoint (default: from config, or :8000) + frontend Vite frontend endpoint (default: localhost:8989) + --backend Cista backend endpoint (default: from config, or :8999) Environment: JS_RUNTIME Path or name of JS runtime to use (deno, npm/node or bun). @@ -26,7 +26,7 @@ from devutil import ProcessGroup, logger, ready, setup_vite # type: ignore from cista import config from cista.serve import parse_listen -DEFAULT_BACKEND_PORT = 8000 +DEFAULT_BACKEND_PORT = 8999 def setup_sanic_backend(listen: str | None) -> tuple[str, list[str]]: @@ -81,13 +81,13 @@ def main(): "frontend", nargs="?", metavar="host:port", - help="Vite frontend endpoint (default: localhost:5173)", + help="Vite frontend endpoint (default: localhost:8989)", ) parser.add_argument( "--backend", "-l", metavar="host:port", - help="Cista backend endpoint (default: from config, or :8000)", + help="Cista backend endpoint (default: from config, or :8999)", ) args = parser.parse_args() with contextlib.suppress(KeyboardInterrupt): diff --git a/scripts/fastapi-vue/devutil.py b/scripts/fastapi-vue/devutil.py index 09b7514..75089c9 100644 --- a/scripts/fastapi-vue/devutil.py +++ b/scripts/fastapi-vue/devutil.py @@ -7,8 +7,8 @@ import httpx from buildutil import find_dev_tool, find_install_tool, logger from fastapi_vue.hostutil import parse_endpoint -DEFAULT_VITE_PORT = 5173 -DEFAULT_BACKEND_PORT = 5180 +DEFAULT_VITE_PORT = 8989 +DEFAULT_BACKEND_PORT = 8999 class ProcessGroup: