mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
d88948bdea
v0.3.0
23 lines
380 B
JavaScript
23 lines
380 B
JavaScript
'use strict'
|
|
|
|
const http = require('http')
|
|
|
|
class Server {
|
|
|
|
constructor (nuxt) {
|
|
this.server = http.createServer(nuxt.render.bind(nuxt))
|
|
return this
|
|
}
|
|
|
|
listen (port, host) {
|
|
host = host || 'localhost'
|
|
port = port || 3000
|
|
this.server.listen(port, host, () => {
|
|
console.log('Ready on http://%s:%s', host, port)
|
|
})
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = Server
|