BODY_SIZE_LIMIT erstellt

This commit is contained in:
titver968
2025-04-25 08:14:39 +02:00
parent 7cf57dde9b
commit ac865ddd37
7 changed files with 30 additions and 9 deletions

16
server.js Normal file
View File

@@ -0,0 +1,16 @@
import { createServer } from 'http';
import { handler } from './build/index.js';
const server = createServer((req, res) => {
if (req.headers['content-length'] > 50 * 1024 * 1024) { // 50 MB
res.statusCode = 413; // Payload Too Large
res.end('Payload Too Large');
return;
}
handler(req, res);
});
server.listen(3000, () => {
console.log('Server läuft auf Port 3000');
});