add image size

post-data
Bastien OLLIER 2 years ago
parent d08af7dcd1
commit e7b3a5e28f

2
.gitignore vendored

@ -1,8 +1,10 @@
node_modules
bun.lockb
pnpm-lock.yaml
package-lock.json
.idea
.vscode
*.js
*.tsbuildinfo
*.d.ts

@ -18,12 +18,15 @@ const server = http.createServer((req, res) => {
switch (req.url) {
case '/run':
const jobId = generateId();
const Code = "echo a";
const Image = "ghcr.io/moshell-lang/moshell:master";
const sizeStingIMage = Image.length;
res.writeHead(200, {
'Content-Type': 'text/event-stream',
Connection: 'keep-alive',
'Cache-Control': 'no-cache',
});
sender.send(`${jobId}echo a`).then(() => {
sender.send(`${jobId}${sizeStingIMage}${Image}${Code}`).then(() => {
res.write('event: connected\n');
res.write(`data: ${jobId}\n`);
res.write('id: 0\n');

Loading…
Cancel
Save