在 Postman 网页版本中,当我使用Get localhost:8080
发送请求时,它只是给出了一个错误。请给我讲讲情况。我的VS代码有问题吗?
const express = require("express");
const app = express();
/* app.use((req, res)=> {
}); */
app.get("/", (req, res) => {
res.send("This is the home page");
});
app.get("/cats", (req, res) => {
res.send("MEOW");
});
app.get("/dogs", (req, res) => {
res.send("woof");
});
app.post("dogs", (req, res) => {
res.send("Post request to /cats. This is diffrent than get");
});
app.get("*", (req, res) => {
res.send("I don't know what that path");
});
app.listen(8080, () => {
console.log("Listening on port 8080");
});
2条答案
按热度按时间5hcedyr01#
云代理运行在云中。
“云”是一个流行语,大致意思是别人的电脑。
他们的计算机无法访问您的专用环回网络接口(即
localhost
)上运行的服务。如果您希望云代理访问您的服务,则需要将其托管在公共互联网上。
qoefvg9y2#
我遇到了一个类似的错误,我不得不下载并在我的本地机器上安装 Postman ,而不是使用 Postman 网络,它工作得很好。