2017.11.01
作者:
Cyril丶 | 来源:发表于
2017-11-01 18:01 被阅读0次
前端:运行在用户的浏览器上
后台:运行在服务器上
node
1 火爆 2 语法就是js语法 3性能非常高
检测安装是否成功1node --version 2 npm --version
node 文件 *.js 注意文件名不能为node.js
自己搭建http服务
1 http协议 2 node已经集成好了 http 3 使用http模块
创建http服务
1引入http模块var http = require(‘http’);
2创建服务var server = http.createServer(function(request,response){});
3监听端口server.listen(8080)
读取文件
创建文件模块(fs=file system)
var fs = require('fs');
读取文件
###fs.readFile('地址',function(err,data){
if(err){
错误
}else{
正确
data是数据
}
})
本文标题:2017.11.01
本文链接:https://www.haomeiwen.com/subject/efvgpxtx.html
网友评论