fix: update code
This commit is contained in:
9
start.sh
9
start.sh
@@ -20,7 +20,14 @@ echo "==> Checking crawler Python deps..."
|
||||
pip install -q -r crawler/requirements.txt 2>/dev/null || true
|
||||
|
||||
echo "==> Seeding database (if needed)..."
|
||||
[ ! -f server/data.db ] && npm run api:seed
|
||||
# 若指定了 DB_PATH,则以 DB_PATH 为准;否则默认使用 server/data.db
|
||||
DB_FILE_PATH="${DB_PATH:-server/data.db}"
|
||||
if [ ! -f "$DB_FILE_PATH" ]; then
|
||||
echo " - DB file not found at $DB_FILE_PATH, running api:seed once"
|
||||
npm run api:seed
|
||||
else
|
||||
echo " - Existing DB detected at $DB_FILE_PATH, skip seeding"
|
||||
fi
|
||||
|
||||
echo "==> Starting API (http://localhost:3001)..."
|
||||
npm run api &
|
||||
|
||||
Reference in New Issue
Block a user