From 6a327b5d2274fd91d70b233f9a540274be76ef32 Mon Sep 17 00:00:00 2001 From: UnknownMp Date: Sat, 14 Jun 2025 19:50:29 +0800 Subject: [PATCH] =?UTF-8?q?[Base]=20=E6=9B=B4=E6=96=B0=20server.js=20?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E6=9B=B4=E8=AF=A6=E7=BB=86=E7=9A=84=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 72d769d..43db0b8 100644 --- a/server.js +++ b/server.js @@ -33,11 +33,13 @@ if (!isProduction) { app.use(base, sirv('./dist/client', { extensions: [] })) } -// Serve HTML +app.set('trust proxy', true); + app.use('*all', async (req, res) => { try { const url = req.originalUrl.replace(base, '') - console.log(`Request ${url}`) + const ua = req.get('User-Agent'); + console.log(`${req.ip} /${url} "${ua}"`) let template let render, getRoute if (!isProduction) {