1 Star 3 Fork 0

peterzhai/你画我猜

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.js 663 Bytes
一键复制 编辑 原始数据 按行查看 历史
peterzhai 提交于 2018-03-28 01:37 . first local
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
import User from './beans/user';
app.get('/', function (req, res) {
res.sendFile(__dirname + '/index.html');
console.log('@@##import:' + User.UUID());
});
io.on('connection', function (socket) {
console.log('a user connected');
socket.broadcast.emit('hi');
socket.on('disconnect', function () {
console.log('user disconnected');
});
socket.on('chat message', function (msg) {
console.log('message: ' + msg);
io.emit('chat message', msg);
});
});
http.listen(3000, function () {
console.log('listening on *:3000');
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/peterzhai/you_draw_me_to_guess.git
[email protected]:peterzhai/you_draw_me_to_guess.git
peterzhai
you_draw_me_to_guess
你画我猜
master

搜索帮助