Nuxt/lib/server.js
Sébastien Chopin d88948bdea map static to /
v0.3.0
2016-11-10 02:19:47 +01:00

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