Spaces:
Sleeping
Sleeping
Update server.js
Browse files
server.js
CHANGED
|
@@ -55,12 +55,17 @@ app.post('/login', async (_req, res) => {
|
|
| 55 |
return res.status(500).json(out);
|
| 56 |
}
|
| 57 |
|
| 58 |
-
const
|
| 59 |
-
res.
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
});
|
| 65 |
|
| 66 |
console.log('🛰️ Public URL will be:', HOSTNAME);
|
|
|
|
| 55 |
return res.status(500).json(out);
|
| 56 |
}
|
| 57 |
|
| 58 |
+
const boundary = '---PNG_BOUNDARY';
|
| 59 |
+
res.set('Content-Type', `multipart/mixed; boundary=${boundary}`);
|
| 60 |
+
|
| 61 |
+
res.write(`--${boundary}\r\n`);
|
| 62 |
+
res.write('Content-Type: application/json\r\n\r\n');
|
| 63 |
+
res.write(JSON.stringify({ ok: true }) + '\r\n');
|
| 64 |
+
|
| 65 |
+
res.write(`--${boundary}\r\n`);
|
| 66 |
+
res.write('Content-Type: image/png\r\n\r\n');
|
| 67 |
+
res.write(out.png);
|
| 68 |
+
res.end(`\r\n--${boundary}--`);
|
| 69 |
});
|
| 70 |
|
| 71 |
console.log('🛰️ Public URL will be:', HOSTNAME);
|