const express = require('express')
const app = express()
app.use(express.static(require('path').join(__dirname, 'public')))
const host = process.env.HOST || 'localhost'
const port = process.env.PORT || 3000
const server = require('http').createServer(app)
const io = require('socket.io')(server)
io.on('connection', (client) => {
    client.emit('welcome')
})
server.listen(port, host, () => console.log(`battleship game server listening at http://${host}:${port}/`))
