1.控制台中实现helloworld
2.js文件中实现helloworld
3.web服务中实现helloworld
4.nodejs上控制台上输出Hello Word返回undefined,什么原因?
console.log('Hello World!');
运行结果:
、
var http = require('http');
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/html; charset=utf-8'});
response.write('Hello World');
response.end();
}).listen(8080);
console.log('Server running at http://localhost:8080/');
运行结果:
因为返回值是undefined,属于正常情况
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/jlq_diligence/article/details/121938137
内容来源于网络,如有侵权,请联系作者删除!