mirror of
https://github.com/desktop/desktop
synced 2024-10-31 11:07:25 +00:00
24 lines
526 B
JavaScript
24 lines
526 B
JavaScript
'use strict'
|
|
|
|
const express = require('express')
|
|
const webpack = require('webpack')
|
|
const config = require('./webpack.development')
|
|
|
|
const app = express()
|
|
const compiler = webpack(config)
|
|
const 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}`)
|
|
})
|