diff --git a/development.md b/development.md index 34ecf95ae..d5ac7c5e6 100644 --- a/development.md +++ b/development.md @@ -28,6 +28,18 @@ npm run format --workspace web/lib npm run format --workspace web/blueprint ``` +### Debug Lilac using pdb + +To attach PDB to the Lilac server: + +```sh +./run_server_pdb.sh +``` + +This starts the Lilac webserver in a single-threaded mode, ready to accept requests and respond to +PDB breakpoints. Pro-tip: Chrome's inspector can take logged network requests and Copy > Copy as +CURL command, which can be used to replay an API call to the Lilac server. + ### Testing Run all the checks before mailing: diff --git a/run_server_pdb.sh b/run_server_pdb.sh new file mode 100755 index 000000000..047f26b04 --- /dev/null +++ b/run_server_pdb.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +export LILAC_PROJECT_DIR='./data' +poetry run python -c "import lilac.server; import uvicorn; uvicorn.run(lilac.server.app, host='0.0.0.0', port=5173)"