62 lines
1.4 KiB
Batchfile
62 lines
1.4 KiB
Batchfile
@echo off
|
|
REM Video to MP3 Transcriptor Server Starter
|
|
REM This script starts the API server on port 8888
|
|
|
|
echo ==========================================
|
|
echo Video to MP3 Transcriptor API
|
|
echo ==========================================
|
|
echo.
|
|
|
|
REM Check if node is installed
|
|
where node >nul 2>nul
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
echo Error: Node.js is not installed
|
|
echo Please install Node.js from https://nodejs.org/
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
REM Check if npm is installed
|
|
where npm >nul 2>nul
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
echo Error: npm is not installed
|
|
echo Please install npm
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
REM Check if .env file exists
|
|
if not exist .env (
|
|
echo Warning: .env file not found
|
|
echo Creating .env file...
|
|
(
|
|
echo OPENAI_API_KEY=
|
|
echo PORT=8888
|
|
echo OUTPUT_DIR=./output
|
|
) > .env
|
|
echo.
|
|
echo Please edit .env and add your OPENAI_API_KEY
|
|
echo.
|
|
)
|
|
|
|
REM Check if node_modules exists
|
|
if not exist node_modules (
|
|
echo Installing dependencies...
|
|
call npm install
|
|
echo.
|
|
)
|
|
|
|
REM Kill any process using port 8888
|
|
echo Checking port 8888...
|
|
npx kill-port 8888 >nul 2>nul
|
|
|
|
echo.
|
|
echo Starting server on http://localhost:8888
|
|
echo Press Ctrl+C to stop the server
|
|
echo.
|
|
echo ==========================================
|
|
echo.
|
|
|
|
REM Start the server
|
|
call npm run server
|