working starter code gen

This commit is contained in:
Ishaan Dey
2024-04-24 01:07:20 -04:00
parent 75ac23094b
commit b6097df612
11 changed files with 126 additions and 118 deletions

View File

@ -24,13 +24,10 @@ export default {
const body = await request.json();
const { sandboxId, type } = initSchema.parse(body);
// startercode.node.forEach(async (file) => {
// await env.R2.put(`${sandboxId}/${file.name}`, file.body);
// });
console.log(startercode[type]);
// parallel data fetching with promise.all:
await Promise.all(
startercode.node.map(async (file) => {
startercode[type].map(async (file) => {
await env.R2.put(`projects/${sandboxId}/${file.name}`, file.body);
})
);