code-server/cursor-fullstack/cloudflare/deploy-frontend-complete.sh
Cursor Agent e5bfb02460 Refactor: Simplify frontend code and dependencies
This commit refactors the frontend code by removing unnecessary meta tags, simplifying CSS, and updating dependencies in package.json and vite.config.js. It also streamlines the App component by removing unused state and props, and improving the loading and error handling.

Co-authored-by: fekofal332 <fekofal332@reaxu.com>
2025-10-13 13:24:25 +00:00

35 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
API_TOKEN="avRH6WSd0ueXkJqbQpDdnseVo9fy-fUSIJ1pdrWC"
ACCOUNT_ID="76f5b050419f112f1e9c5fbec1b3970d"
PROJECT_NAME="cursor-ide"
echo "رفع Frontend إلى Cloudflare Pages..."
# رفع الملفات مباشرة
cd frontend/dist
# رفع index.html
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects/$PROJECT_NAME/assets/index.html" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: text/html" \
--data-binary @index.html
# رفع CSS
if [ -f "assets/index.css" ]; then
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects/$PROJECT_NAME/assets/index.css" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: text/css" \
--data-binary @assets/index.css
fi
# رفع JS
if [ -f "assets/index.js" ]; then
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects/$PROJECT_NAME/assets/index.js" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/javascript" \
--data-binary @assets/index.js
fi
echo "تم رفع Frontend بنجاح!"
echo "Frontend URL: https://cursor-ide.pages.dev"