nodejs尝试创建WEB服务器无法访问localhost

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
TianyiZhang1118
帖子: 15
注册时间: 2016-12-31 9:01
系统: ubuntu 16.04

nodejs尝试创建WEB服务器无法访问localhost

#1

帖子 TianyiZhang1118 » 2017-01-02 13:21

这是我的代码

代码: 全选


var http = require('http');

http.createServer(function(req, res){

  res.writeHead(200,{'Content-Type':'text/plain'})
  res.end('link my server')

}).listen(8888)

console.log('Server has located')

TianyiZhang1118
帖子: 15
注册时间: 2016-12-31 9:01
系统: ubuntu 16.04

Re: nodejs尝试创建WEB服务器无法访问localhost

#2

帖子 TianyiZhang1118 » 2017-01-02 22:03

TianyiZhang1118 写了:这是我的代码

代码: 全选


var http = require('http');

http.createServer(function(req, res){

  res.writeHead(200,{'Content-Type':'text/plain'})
  res.end('link my server')

}).listen(8888)

console.log('Server has located')



抱歉,我自己来终结这个问题,进地址的适合忘记输入端口了..! 2017 大家新年快乐啊~
头像
qy117121
论坛版主
帖子: 50538
注册时间: 2007-12-14 13:40
系统: Winbuntu
来自: 志虚国乌由市
联系:

Re: nodejs尝试创建WEB服务器无法访问localhost

#3

帖子 qy117121 » 2017-01-02 22:13

果然是端口。。。。。
渠月 · QY   
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu

Ubuntu 20.04 快速设置指南,请配合浏浏览器自动翻译使用

邮箱 chuan@ubuntu.org.cn
回复