mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
17 lines
347 B
JavaScript
17 lines
347 B
JavaScript
import express from 'express'
|
|
import http from 'http'
|
|
import socketServer from './socket.js'
|
|
|
|
const port = 3000
|
|
const app = express()
|
|
const server = http.createServer(app)
|
|
socketServer(server)
|
|
|
|
app.get('/', (req, res) => {
|
|
res.send('Hello World!')
|
|
})
|
|
|
|
server.listen(port, () => {
|
|
console.log(`Server listening at http://localhost:${port}`)
|
|
})
|