You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
const express = require('express')
|
|
|
|
const app = express()
|
|
|
|
|
|
|
|
app.use('/', express.static('dist'))
|
|
|
|
|
|
|
|
app.get('/hello', function (req, res) {
|
|
|
|
res.send('Hello World!')
|
|
|
|
})
|
|
|
|
|
|
|
|
const server = app.listen(3000, function () {
|
|
|
|
console.log('Example app listening on port 3000!')
|
|
|
|
})
|
|
|
|
|
|
|
|
const io = require('socket.io').listen(server);
|
|
|
|
|
|
|
|
io.on('connection', (socket) => {
|
|
|
|
socket.emit('message', 'hello socket');
|
|
|
|
});
|