diff --git a/apps/api-hono/package.json b/apps/api-hono/package.json index 34cc025..eeb9556 100644 --- a/apps/api-hono/package.json +++ b/apps/api-hono/package.json @@ -1,7 +1,7 @@ { "name": "@repo/api-hono", "scripts": { - "start": "dotenv -e .env.production -- bash -c 'echo $DATABASE_URL && npx prisma migrate deploy && tsx src/index.ts'", + "start": "echo $DATABASE_URL && npx prisma migrate deploy && tsx src/index.ts", "dev": "run-p dev:* export-type", "dev:server": "dotenv -e .env.local -- tsx watch src/index.ts", "dev-email": "dotenv -e .env.local -- email dev --dir ./src/infrastructure/email/templates", diff --git a/apps/api-hono/src/index.ts b/apps/api-hono/src/index.ts index 01c5661..aace952 100644 --- a/apps/api-hono/src/index.ts +++ b/apps/api-hono/src/index.ts @@ -34,6 +34,19 @@ const newApp = () => { app.use( cors({ origin: env.WEBAPP_URL, + allowHeaders: [ + 'Content-Type', // Specify the format of the data + // 'Authorization', // Authentication information (if needed) + 'Accept', // Indicate the response format the client accepts + 'Origin', // Indicate the origin of the CORS request + 'Cookie', // Cookie information (sent from frontend) + 'Set-Cookie', // Set cookies (sent from server) + 'Cache-Control', // Control caching strategy + 'Referer', // Referrer information + 'Content-Length', // Specify the size of the payload + 'Accept-Language', // For multi-language support + ], + allowMethods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'], credentials: true, }), ) diff --git a/apps/app/wrangler.toml b/apps/app/wrangler.toml index 0fcc5a9..3fe1daf 100644 --- a/apps/app/wrangler.toml +++ b/apps/app/wrangler.toml @@ -15,9 +15,9 @@ pages_build_output_dir = "./build/client" # - https://developers.cloudflare.com/pages/functions/bindings/#environment-variables # Note: Use secrets to store sensitive data. # - https://developers.cloudflare.com/pages/functions/bindings/#secrets -[vars] -APP_ENV="production" -API_BASE_URL="https://api-hono-young-river-2449.fly.dev/" +#[vars] +#APP_ENV="production" +#API_BASE_URL="https://api-hono-young-river-2449.fly.dev/" # Bind the Workers AI model catalog. Run machine learning models, powered by serverless GPUs, on Cloudflare’s global network # Docs: https://developers.cloudflare.com/pages/functions/bindings/#workers-ai