我正在尝试使用Express制作一个简单的 hello world 类型的服务器。这是我的代码:
const express = require("express");
const app = express();
app.get("/",function(request, response){//what to do when someone make get request to the homepage or route
console.log(request);
response.send("hello");
});
app.listen(3000, function(){
console.log("server is listening at port 3000");
});
Run Code Online (Sandbox Code Playgroud)
当我运行程序时,我在命令提示符下看到了这个:
server is listening at port 3000
但是当我通过浏览器ie 访问它时https://localhost:3000,我收到一个错误:
此站点无法提供安全连接本地主机发送了无效响应。尝试运行 Windows 网络诊断。ERR_SSL_PROTOCOL_ERROR
我希望浏览器hello按照我上面的方法看到,response.send("hello")
| 归档时间: |
|
| 查看次数: |
7438 次 |
| 最近记录: |