I mean depends on the stack. If you need lots of pieces then monolithic can be easier to maintain an
I mean depends on the stack. If you need lots of pieces then monolithic can be easier to maintain and deploy
--remote flag with wrangler dev? I am not sure how it works with DO but that is the standard way for interacting with remote bindingsUse global variables to persist data between requests on individual nodes

Uncaught (in promise) TypeError: This ReadableStream did not return bytes.Text(En/De)coder?writer.close() before the response has been received?WritableStream14400Text(En/De)coderwriter.close()WritableStreamTypescript
const { readable, writable } = new TransformStream();
const writer = writable.getWriter();
const encoder = new TextEncoder();
const response = new Response(readable, {
headers: {
...corsHeaders,
},
});
(async () => {
try {
for await (const chunk of completions) {
const content = chunk['choices'][0].delta.content!;
const encodedMessage = encoder.encode(content);
writer.write(encodedMessage);
}
writer.close();
} catch (e) {
console.error(e);
// writer.abort(e);
return new Response('bad bad error', { headers: corsHeaders });
}
})();
return response;14400const { readable, writable } = new TransformStream();
const writer = writable.getWriter();
const encoder = new TextEncoder();
try {
for await (const chunk of completions) {
const content = chunk['choices'][0].delta.content!;
const encodedMessage = encoder.encode(content);
writer.write(encodedMessage);
}
writer.close();
return new Response(readable, {
headers: {
...corsHeaders,
},
});
} catch (e) {
console.error(e);
// writer.abort(e);
return new Response('bad bad error', { headers: corsHeaders });
}