Host: sql12.freesqldatabase.com
Database: sql12791893
User: sql12791893
Password: 3ALYm8PAgb
Port: 3306
# Install Vercel CLI
npm i -g vercel
# Navigate to backend directory
cd backend
# Deploy to Vercel
vercel
# Follow the prompts:
# - Set up and deploy: Yes
# - Which scope: Select your account
# - Link to existing project: No
# - Project name: superbot-backend
# - Directory: ./
# - Override settings: No- Go to vercel.com
- Create new project
- Upload the
backendfolder - Set environment variables in dashboard:
DB_HOST=sql12.freesqldatabase.com DB_USER=sql12791893 DB_PASSWORD=3ALYm8PAgb DB_NAME=sql12791893 DB_PORT=3306 PORT=5001
After deployment, you'll get a URL like:
https://superbot-backend-xxxxx.vercel.app
const config = {
development: {
API_URL: 'http://localhost:5001/api'
},
production: {
API_URL: 'https://your-actual-backend-url.vercel.app/api'
}
};VITE_API_URL=https://your-actual-backend-url.vercel.app/api
curl https://your-backend-url.vercel.app/api/healthcurl https://your-backend-url.vercel.app/api/tasks{
"status": "ok",
"message": "Server is running",
"database": {
"host": "sql12.freesqldatabase.com",
"database": "sql12791893",
"connected": true
}
}# Install terser
npm install terser --save-dev
# Build the project
npm run build
# Deploy to Vercel
vercel --prod- Backend deployed to Vercel
- Database connection working
- Health endpoint responding
- Tasks API returning data
- Frontend configuration updated
- Frontend deployed with correct backend URL
- No CORS errors in browser console
- Check Vercel logs for errors
- Verify environment variables are set
- Ensure all dependencies are in package.json
- Verify database credentials
- Check if database is accessible from Vercel
- Test connection locally first
- Verify backend URL is correct
- Check CORS configuration
- Test backend endpoints directly
cd backend
vercel --prodnpm run build
vercel --prodcurl https://your-backend-url.vercel.app/api/health
curl https://your-backend-url.vercel.app/api/tasksAfter deployment, your frontend should:
- ✅ Load without MIME type errors
- ✅ Connect to your backend successfully
- ✅ Display tasks and finance data
- ✅ Work on both localhost and hosted URL