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');
});
