我刚开始探索node.js. 在我的Windows服务器上安装了msi文件.我的代码在命令窗口中返回我预期的输出
var http = require("http");
http.createServer(function (request, response) {
// Send the HTTP header
// HTTP Status: 200 : OK
// Content Type: text/plain
response.writeHead(200, {'Content-Type': 'text/plain'});
// Send the response body as "Hello World"
response.end('Hello World\n');
}).listen(8081);
// Console will print the message
console.log('Server running at `http://127.0.0.1:8081/`');
Run Code Online (Sandbox Code Playgroud)
但是当我输入http://127.0.0.1:8081/我的浏览器时 ,我得不到任何输出.当我看到控制台我得到低于错误
Failed to load resource: the server responded with a status of 403 (Forbidden)
Run Code Online (Sandbox Code Playgroud)
我错了怎么解决?我正在关注此链接
| 归档时间: |
|
| 查看次数: |
6501 次 |
| 最近记录: |