Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix deploy setting #9

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/api-hono/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 13 additions & 0 deletions apps/api-hono/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
)
Expand Down
6 changes: 3 additions & 3 deletions apps/app/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading