把通讯模块单独划分出来

This commit is contained in:
2023-12-15 11:48:47 +00:00
parent 9e7afe6601
commit d9fefc87b3
3 changed files with 87 additions and 85 deletions

View File

@ -103,6 +103,9 @@ backend.stdout.on('data', (data) => {
app.get('/', (req, res) => {
res.sendFile(join(__dirname, 'index.html'));
});
app.get('/communication.js', (req, res) => {
res.sendFile(join(__dirname, 'communication.js'));
});
io.on('connection', async (socket) => {
console.log('a user connected');