问题描述
我在 NodeJS 中有一个快速服务器。它有一个带有 console.logs 的 POST 请求。在哪里可以找到 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',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请求函数中的console.logs出现在哪里?我之所以这么问是因为我想看看更复杂的 POST 请求中的逻辑发生了什么。