diff --git a/web/.env.example b/web/.env.example new file mode 100644 index 0000000..1127d75 --- /dev/null +++ b/web/.env.example @@ -0,0 +1,18 @@ +POSTGRES_DATABASE="verceldb" +POSTGRES_HOST="localhost:5480" +POSTGRES_PASSWORD="postgres" +POSTGRES_PRISMA_URL="postgres://postgres:postgres@localhost:5480/verceldb?pgbouncer=true&connect_timeout=15" +POSTGRES_SSL="false" +POSTGRES_URL="postgres://postgres:postgres@localhost:5480/verceldb" +POSTGRES_URL_NON_POOLING="postgres://postgres:postgres@localhost:5480/verceldb" +POSTGRES_USER="postgres" + +NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY= +CLERK_SECRET_KEY= + +SPACES_ENDPOINT="http://localhost:4566" +SPACES_ENDPOINT_CDN="http://localhost:4566" +SPACES_REGION="nyc3" +SPACES_BUCKET="comfyui-deploy" +SPACES_KEY="xyz" +SPACES_SECRET="aaa" \ No newline at end of file diff --git a/web/src/app/api/file-upload/route.ts b/web/src/app/api/file-upload/route.ts index 0c65efb..0d96918 100644 --- a/web/src/app/api/file-upload/route.ts +++ b/web/src/app/api/file-upload/route.ts @@ -19,7 +19,7 @@ export async function GET(request: Request) { try { const uploadUrl = await handleResourceUpload({ - resourceBucket: "comfyui-deploy", + resourceBucket: process.env.SPACES_BUCKET, resourceId: `outputs/runs/${run_id}/${file_name}`, resourceType: type, isPublic: true, diff --git a/web/src/app/api/run/route.ts b/web/src/app/api/run/route.ts index 485206e..c3f2304 100644 --- a/web/src/app/api/run/route.ts +++ b/web/src/app/api/run/route.ts @@ -32,7 +32,7 @@ export async function GET(request: Request) { for (let j = 0; j < output.data?.images.length; j++) { const element = output.data?.images[j]; element.url = replaceCDNUrl( - `${process.env.SPACES_ENDPOINT}/comfyui-deploy/outputs/runs/${run.id}/${element.filename}` + `${process.env.SPACES_ENDPOINT}/${process.env.SPACES_BUCKET}/outputs/runs/${run.id}/${element.filename}` ); } } diff --git a/web/src/app/api/view/route.ts b/web/src/app/api/view/route.ts index 1a7031c..d3ca8ac 100644 --- a/web/src/app/api/view/route.ts +++ b/web/src/app/api/view/route.ts @@ -5,6 +5,8 @@ export async function GET(request: NextRequest) { const file = new URL(request.url).searchParams.get("file"); // console.log(`${process.env.SPACES_ENDPOINT}/comfyui-deploy/${file}`); return NextResponse.redirect( - replaceCDNUrl(`${process.env.SPACES_ENDPOINT}/comfyui-deploy/${file}`) + replaceCDNUrl( + `${process.env.SPACES_ENDPOINT}/${process.env.SPACES_BUCKET}/${file}` + ) ); }