turn webpack middleware into middleware

fix HMR middleware, and some loopback boilerplate cleanup
This commit is contained in:
2017-01-22 12:02:04 -07:00
parent c85b2e2702
commit f9e237da09
13 changed files with 75 additions and 61 deletions

View File

@@ -1,20 +1,9 @@
/* eslint-disable no-console */
const path = require('path');
const loopback = require('loopback');
const boot = require('loopback-boot');
const app = module.exports = loopback();
const bootOptions = {
appRootDir: path.resolve(__dirname),
bootScripts: [
'boot/authentication.js',
'boot/webpack-dev.js',
'boot/webpack-hmr.js',
'boot/root.js',
],
};
// start the webserver
app.start = () => app.listen(() => {
app.emit('started');
@@ -30,7 +19,7 @@ app.start = () => app.listen(() => {
// Bootstrap the application, configure models, datasources and middleware.
// Sub-apps like REST API are mounted via boot scripts.
boot(app, bootOptions, (err) => {
boot(app, __dirname, (err) => {
if (err) throw err;
// start the server if `$ node server.js`