Diverse anpassungen
This commit is contained in:
14
server.js
14
server.js
@@ -9,8 +9,18 @@ const app = express();
|
||||
const PORT = 3333;
|
||||
|
||||
// Middleware
|
||||
app.use(bodyParser.urlencoded({ extended: true }));
|
||||
app.use(bodyParser.json());
|
||||
// UTF-8 explizit für URL-encoded Daten setzen (wichtig für Sonderzeichen wie ß, ü, ö, ä)
|
||||
app.use(bodyParser.urlencoded({
|
||||
extended: true,
|
||||
type: 'application/x-www-form-urlencoded',
|
||||
parameterLimit: 1000,
|
||||
limit: '10mb'
|
||||
}));
|
||||
// Explizit UTF-8 für JSON
|
||||
app.use(bodyParser.json({
|
||||
type: 'application/json',
|
||||
limit: '10mb'
|
||||
}));
|
||||
// Trust proxy für korrekte Client-IP-Erkennung (wichtig bei Proxies/Reverse Proxies)
|
||||
app.set('trust proxy', true);
|
||||
app.use(express.static('public'));
|
||||
|
||||
Reference in New Issue
Block a user