-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdev.js
33 lines (24 loc) · 830 Bytes
/
dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"use strict";
import express from 'express';
import path from 'path';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware';
import config from './webpack.config';
import routes from './routes';
import auth from './auth';
const app = express();
const port = 3000;
const compiler = webpack(config)
app.use(express.static(path.join(__dirname + '/public')));
app.use(webpackDevMiddleware(compiler, { noInfo: true, publicPath: config.output.path }))
app.use(webpackHotMiddleware(compiler));
app.use(routes);
app.listen(port, function(error) {
if (error) {
console.error(error)
} else {
console.info("==> 🌎 Listening on port %s. Open up http://localhost:%s/ in your browser.", port, port)
}
})
export default app;