mirror of
https://github.com/desktop/desktop
synced 2024-10-31 11:07:25 +00:00
22 lines
495 B
JavaScript
22 lines
495 B
JavaScript
var express = require('express')
|
|
var webpack = require('webpack')
|
|
var config = require('./webpack.config')
|
|
|
|
var app = express()
|
|
var compiler = webpack(config)
|
|
var port = process.env.PORT || 3000
|
|
|
|
app.use(require('webpack-dev-middleware')(compiler, {
|
|
publicPath: config.output.publicPath
|
|
}))
|
|
|
|
app.use(require('webpack-hot-middleware')(compiler))
|
|
|
|
app.listen(port, 'localhost', err => {
|
|
if (err) {
|
|
console.log(err)
|
|
return
|
|
}
|
|
|
|
console.log(`Listening at http://localhost:${port}`)
|
|
})
|