mirror of
https://git.victorphan.net/basketballcantho/ten-project.git
synced 2026-08-05 09:53:10 +07:00
update chức năng gán file mp3 vào trang pdf
This commit is contained in:
+19
-1
@@ -27,7 +27,7 @@ JWT_SECRET_KEY="${JWT_SECRET_KEY:?JWT_SECRET_KEY is not set in .env}"
|
||||
FRONTEND_PORT="${FRONTEND_PORT:-3011}"
|
||||
BACKEND_PORT="${BACKEND_PORT:-8001}"
|
||||
|
||||
DATABASE_URL="postgresql+psycopg2://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5433/${POSTGRES_DB}"
|
||||
DATABASE_URL="postgresql+psycopg2://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}"
|
||||
UPLOAD_DIR="./backend/uploads"
|
||||
|
||||
# ── Colors ────────────────────────────────────────────────────────────────────
|
||||
@@ -40,6 +40,15 @@ TARGET="${1:-both}"
|
||||
start_backend() {
|
||||
echo -e "${CYAN}${BOLD}▶ Starting Backend${NC} (port ${BACKEND_PORT})"
|
||||
|
||||
# Kill any process already occupying the backend port
|
||||
local old_pid
|
||||
old_pid=$(lsof -ti tcp:"$BACKEND_PORT" 2>/dev/null || true)
|
||||
if [ -n "$old_pid" ]; then
|
||||
echo -e "${YELLOW} Killing process on port ${BACKEND_PORT} (PID ${old_pid})...${NC}"
|
||||
kill -9 $old_pid 2>/dev/null || true
|
||||
sleep 0.5
|
||||
fi
|
||||
|
||||
# Check Python venv
|
||||
VENV=""
|
||||
if [ -d backend/.venv ]; then
|
||||
@@ -78,6 +87,15 @@ start_backend() {
|
||||
start_frontend() {
|
||||
echo -e "${CYAN}${BOLD}▶ Starting Frontend${NC} (port ${FRONTEND_PORT})"
|
||||
|
||||
# Kill any process already occupying the frontend port
|
||||
local old_pid
|
||||
old_pid=$(lsof -ti tcp:"$FRONTEND_PORT" 2>/dev/null || true)
|
||||
if [ -n "$old_pid" ]; then
|
||||
echo -e "${YELLOW} Killing process on port ${FRONTEND_PORT} (PID ${old_pid})...${NC}"
|
||||
kill -9 $old_pid 2>/dev/null || true
|
||||
sleep 0.5
|
||||
fi
|
||||
|
||||
if [ ! -d frontend/node_modules ]; then
|
||||
echo -e "${YELLOW} node_modules not found — running npm install...${NC}"
|
||||
(cd frontend && npm install)
|
||||
|
||||
Reference in New Issue
Block a user