$ git clone [email protected]:strongloop/loopback-example-middleware.git
$ cd loopback-example-middleware
$ npm install
$ node .
- Add static middleware to the files property in middleware.json
- Delete
server/boot/root.js. - Create
client/index.html - Start the server via
node .and browse tolocalhost:3000. You should seehello worldbeing served.
- Create a single function that all errors are passed to.
- Set
app.get('remoting').errorHandlerto call a custom error handler. - Create a
custom error middlewareto handle errors not thrown by theloopback.rest()middleware.
Note: you must register your custom error handler in the middleware.json config file.