forked from jfrench206/audio-vibrator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
20 lines (16 loc) · 648 Bytes
/
server.js
File metadata and controls
20 lines (16 loc) · 648 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const express = require('express')
const webpack = require('webpack')
const webpackDevMiddleware = require('webpack-dev-middleware')
const app = express()
const config = require('./webpack.config.js')
const compiler = webpack(config)
app.use('/assets', express.static('assets'))
// Tell express to use the webpack-dev-middleware and use the webpack.config.js
// configuration file as a base - except explicitly define publicPath so dev environment works right
app.use(webpackDevMiddleware(compiler, {
publicPath: '/'
}))
// Serve the files on port 3000.
app.listen(3000, function () {
console.log('Example app listening on port 3000!\n')
})