turn webpack middleware into middleware
fix HMR middleware, and some loopback boilerplate cleanup
This commit is contained in:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user