videotomp3transcriptor/start-server.sh
StillHammer d4ac6f5859 Add documentation, Claude config, and update services
- Add comprehensive API documentation in docs/API.md
- Add Claude project instructions (CLAUDE.md)
- Add server startup scripts for Windows and Unix
- Update transcription, translation, and summarize services
- Update server.js with latest changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 13:24:31 +08:00

59 lines
1.3 KiB
Bash

#!/bin/bash
# Video to MP3 Transcriptor Server Starter
# This script starts the API server on port 8888
echo "=========================================="
echo "Video to MP3 Transcriptor API"
echo "=========================================="
echo ""
# Check if node is installed
if ! command -v node &> /dev/null
then
echo "Error: Node.js is not installed"
echo "Please install Node.js from https://nodejs.org/"
exit 1
fi
# Check if npm is installed
if ! command -v npm &> /dev/null
then
echo "Error: npm is not installed"
echo "Please install npm"
exit 1
fi
# Check if .env file exists
if [ ! -f .env ]; then
echo "Warning: .env file not found"
echo "Creating .env file..."
echo "OPENAI_API_KEY=" > .env
echo "PORT=8888" >> .env
echo "OUTPUT_DIR=./output" >> .env
echo ""
echo "Please edit .env and add your OPENAI_API_KEY"
echo ""
fi
# Check if node_modules exists
if [ ! -d "node_modules" ]; then
echo "Installing dependencies..."
npm install
echo ""
fi
# Kill any process using port 8888
echo "Checking port 8888..."
npx kill-port 8888 2>/dev/null
echo ""
echo "Starting server on http://localhost:8888"
echo "Press Ctrl+C to stop the server"
echo ""
echo "=========================================="
echo ""
# Start the server
npm run server