-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·47 lines (39 loc) · 1.29 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·47 lines (39 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Tweet Reply Generator - Startup Script
echo "🐦 Starting Tweet Reply Generator..."
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js first."
echo "Visit: https://nodejs.org/"
exit 1
fi
# Check if .env file exists
if [ ! -f .env ]; then
echo "⚠️ .env file not found. Creating from template..."
cp .env.example .env
echo "📝 Please edit .env file and add your OpenRouter API key:"
echo " OPENROUTER_API_KEY=your_api_key_here"
echo ""
echo "Get your free API key from: https://openrouter.ai/"
exit 1
fi
# Check if API key is set
if ! grep -q "OPENROUTER_API_KEY=sk-" .env 2>/dev/null; then
echo "⚠️ OpenRouter API key not found in .env file."
echo "📝 Please edit .env file and add your API key:"
echo " OPENROUTER_API_KEY=your_api_key_here"
echo ""
echo "Get your free API key from: https://openrouter.ai/"
exit 1
fi
# Install dependencies if node_modules doesn't exist
if [ ! -d "node_modules" ]; then
echo "📦 Installing dependencies..."
npm install
fi
# Start the server
echo "🚀 Starting server..."
echo "📱 Open http://localhost:3000 in your browser"
echo "⏹️ Press Ctrl+C to stop the server"
echo ""
npm start