Skip to content

AddJunZ/chat-room

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chat-room(计网课设)

开启服务

//安装依赖包
npm install

//启动服务
npm start

笔记

敬请期待:smirk:

socket传值的时候一定要传一个对象不能传多个参数吗

//正确
socket.emit('toPersonMsg',{
    value:value,
    msg:msg
})
//错误??
scoket.emit('toPersonMsg',value,msg)

ctx.socket和server.io的针对于emit的区别?

接收到文件之后,我们需要把文件保存到目录中,返回一个 url 给前端。在 node 中的流程为

创建可读流 const reader = fs.createReadStream(file.path)

创建可写流 const writer = fs.createWriteStream('upload/newpath.txt')

可读流通过管道写入可写流 reader.pipe(writer)

koa-send是文件下载中间件

//跟ctx.attachment的关系?

About

计网课设

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published