Spaces:
Running
Running
fix
Browse files
README.md
CHANGED
|
@@ -7,6 +7,7 @@ sdk: docker
|
|
| 7 |
pinned: true
|
| 8 |
app_port: 3000
|
| 9 |
license: mit
|
|
|
|
| 10 |
short_description: Generate any application by Vibe Coding
|
| 11 |
models:
|
| 12 |
- deepseek-ai/DeepSeek-V3-0324
|
|
|
|
| 7 |
pinned: true
|
| 8 |
app_port: 3000
|
| 9 |
license: mit
|
| 10 |
+
failure_strategy: rollback
|
| 11 |
short_description: Generate any application by Vibe Coding
|
| 12 |
models:
|
| 13 |
- deepseek-ai/DeepSeek-V3-0324
|
app/api/me/projects/[namespace]/[repoId]/download/route.ts
CHANGED
|
@@ -82,9 +82,9 @@ export async function GET(
|
|
| 82 |
}
|
| 83 |
}
|
| 84 |
|
| 85 |
-
// Generate the ZIP file
|
| 86 |
-
const
|
| 87 |
-
type: "
|
| 88 |
compression: "DEFLATE",
|
| 89 |
compressionOptions: {
|
| 90 |
level: 6
|
|
@@ -96,11 +96,11 @@ export async function GET(
|
|
| 96 |
const filename = `${projectName}.zip`;
|
| 97 |
|
| 98 |
// Return the ZIP file
|
| 99 |
-
return new NextResponse(
|
| 100 |
headers: {
|
| 101 |
"Content-Type": "application/zip",
|
| 102 |
"Content-Disposition": `attachment; filename="${filename}"`,
|
| 103 |
-
"Content-Length":
|
| 104 |
},
|
| 105 |
});
|
| 106 |
} catch (error: any) {
|
|
|
|
| 82 |
}
|
| 83 |
}
|
| 84 |
|
| 85 |
+
// Generate the ZIP file as a Blob
|
| 86 |
+
const zipBlob = await zip.generateAsync({
|
| 87 |
+
type: "blob",
|
| 88 |
compression: "DEFLATE",
|
| 89 |
compressionOptions: {
|
| 90 |
level: 6
|
|
|
|
| 96 |
const filename = `${projectName}.zip`;
|
| 97 |
|
| 98 |
// Return the ZIP file
|
| 99 |
+
return new NextResponse(zipBlob, {
|
| 100 |
headers: {
|
| 101 |
"Content-Type": "application/zip",
|
| 102 |
"Content-Disposition": `attachment; filename="${filename}"`,
|
| 103 |
+
"Content-Length": zipBlob.size.toString(),
|
| 104 |
},
|
| 105 |
});
|
| 106 |
} catch (error: any) {
|