Add Cloudflare Workers configuration

This commit is contained in:
cloudflare-workers-and-pages[bot]
2026-05-04 16:13:49 +00:00
committed by GitHub
parent 10bd6848ef
commit 5a4e011d0e
5 changed files with 1466 additions and 6 deletions
+7
View File
@@ -32,3 +32,10 @@ data/contact-submissions.json
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?
# wrangler files
.wrangler
.dev.vars*
!.dev.vars.example
.env*
!.env.example
+1435 -1
View File
File diff suppressed because it is too large Load Diff
+6 -3
View File
@@ -10,8 +10,9 @@
"build": "tsc -b && vite build", "build": "tsc -b && vite build",
"start": "node --env-file=.env server.js", "start": "node --env-file=.env server.js",
"lint": "eslint .", "lint": "eslint .",
"preview": "vite preview", "preview": "npm run build && wrangler dev",
"chatbot:eval": "node scripts/evaluate-chatbot.mjs" "chatbot:eval": "node scripts/evaluate-chatbot.mjs",
"deploy": "npm run build && wrangler deploy"
}, },
"dependencies": { "dependencies": {
"express": "^5.2.1", "express": "^5.2.1",
@@ -23,6 +24,7 @@
"resend": "^6.10.0" "resend": "^6.10.0"
}, },
"devDependencies": { "devDependencies": {
"@cloudflare/vite-plugin": "^1.35.0",
"@eslint/js": "^9.39.4", "@eslint/js": "^9.39.4",
"@types/node": "^24.12.0", "@types/node": "^24.12.0",
"@types/react": "^19.2.14", "@types/react": "^19.2.14",
@@ -35,6 +37,7 @@
"globals": "^17.4.0", "globals": "^17.4.0",
"typescript": "~5.9.3", "typescript": "~5.9.3",
"typescript-eslint": "^8.56.1", "typescript-eslint": "^8.56.1",
"vite": "^8.0.0" "vite": "^8.0.0",
"wrangler": "^4.87.0"
} }
} }
+3 -1
View File
@@ -1,9 +1,11 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
import { cloudflare } from "@cloudflare/vite-plugin";
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [react(), cloudflare()],
server: { server: {
proxy: { proxy: {
'/api': 'http://localhost:4173', '/api': 'http://localhost:4173',
+14
View File
@@ -0,0 +1,14 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "siteforge",
"compatibility_date": "2026-05-04",
"observability": {
"enabled": true
},
"assets": {
"not_found_handling": "single-page-application"
},
"compatibility_flags": [
"nodejs_compat"
]
}