[英]Where do you see console.log statements inside a POST request NodeJS express server?
我在 NodeJS 中有一个快速服务器。 它有一个 POST 请求,其中包含 console.logs。 在哪里可以找到 console.logs?
const express = require('express');
const cors = require('cors');
const app = express();
app.use(cors());
app.use(express.json());
const PORT = 5000;
app.get('/', (req, res) => {
console.log("this appears in the browser");
});
app.post('/login', (req, res) => {
console.log("where do I see this text??");
});
app.listen(PORT, '0.0.0.0', function() {
console.log("Server started (this text appears in the terminal)");
});
我正在从命令提示符运行服务器。 不在请求中的 console.logs 会出现在其中。 POST请求function中的console.logs出现在哪里? 我问是因为我想看看更复杂的 POST 请求中的逻辑发生了什么。
它将出现在您让服务器运行的同一终端中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.