我在尝试启动Node.js时正在查看这篇文章,我开始使用本指南来学习基础知识.
我的服务器的代码是:
var http = require('http');
http.createServer(function (request, response) {
request.on('end', function() {
response.writeHead(200, {
'Content-Type' : 'text/plain'
});
response.end('Hello HTTP!');
});
}).listen(8080);
Run Code Online (Sandbox Code Playgroud)
当我去localhost:8080(根据指南),我得到一个'没有数据收到'错误.我看到一些页面说https://是必需的,但是会返回'SSL Connection Error'.我无法弄清楚我错过了什么.