随笔分类 -  node

node的一些知识点
摘要://path模块 1.Node.js path 模块提供了一些用于处理文件路径的小工具,我们可以通过以下方式引入该模块: var path = require("path") 2.常用方法 ================path.join([...paths]) path.join() 方法使用平台特定的分隔符把全部给定的 path 片段连接到一起,并规范化生成的路径 会正确使用当前系统的路... 阅读全文
posted @ 2018-12-19 14:34 宝2333 阅读(1262) 评论(0) 推荐(0)
摘要:const http = require('http'); const fs = require('fs'); const path = require('path'); const url = require('url'); const mime = require('mime'); const qs = require('querystring'); const router = requi... 阅读全文
posted @ 2018-12-19 14:30 宝2333 阅读(460) 评论(0) 推荐(0)
摘要:WebSocket 是一种网络通信协议。RFC6455 定义了它的通信标准。 WebSocket 是 HTML5 开始提供的一种在单个 TCP 连接上进行全双工通讯的协议。 创建简易的聊天室 Document 引入socket.io.js 登录 ... 阅读全文
posted @ 2018-12-19 14:22 宝2333 阅读(190) 评论(0) 推荐(0)
摘要://爬取静态页面 const request = require ('request'); const cheerio = require('cheerio'); const mysql = require('mysql'); var conn = mysql.createConnection({ host:'localhost', user:'root', passwo... 阅读全文
posted @ 2018-12-19 14:13 宝2333 阅读(182) 评论(0) 推荐(0)
摘要:ejs的模板 "> "> --------------- 约有件 dbpool连接池var mysql = require('mysq... 阅读全文
posted @ 2018-12-18 19:52 宝2333 阅读(219) 评论(0) 推荐(1)
摘要:body-parser - node.js 中间件,用于处理 JSON, Raw, Text 和 URL 编码的数据。 cookie-parser - 这就是一个解析Cookie的工具。通过req.cookies可以取到传过来的cookie,并把它们转成对象 multer - node.js 中间件 阅读全文
posted @ 2018-12-18 19:41 宝2333 阅读(178) 评论(0) 推荐(1)