Log proxy default requests

This commit is contained in:
Ben Allfree 2024-01-03 09:32:11 -08:00
parent deedd83fc6
commit fd49e063f6

View File

@ -47,7 +47,14 @@ forEach(hostnameRoutes, (target, host) => {
const handler = createProxyMiddleware({ const handler = createProxyMiddleware({
target: `http://localhost:${DAEMON_PORT()}`, target: `http://localhost:${DAEMON_PORT()}`,
}) })
app.all(`*`, handler) app.all(`*`, (req, res, next) => {
const method = req.method
const fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl
console.log(`${method} ${fullUrl} -> ${`http://localhost:${DAEMON_PORT()}`}`)
handler(req, res, next)
})
if (IS_DEV()) { if (IS_DEV()) {
http.createServer(app).listen(80, () => { http.createServer(app).listen(80, () => {