Skip to content

Commit

Permalink
jekyll fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sequoia authored Oct 12, 2016
1 parent 80862d0 commit e1ba2a9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#loopback-example-middleware
# loopback-example-middleware
```
$ git clone [email protected]:strongloop/loopback-example-middleware.git
$ cd loopback-example-middleware
Expand All @@ -8,14 +8,13 @@ $ node .

- [How do you serve static content via static middleware?](https://github.com/strongloop/loopback-example-middleware#how-do-you-serve-static-content-via-static-middleware)

#How do you serve static content via static middleware?
## How do you serve static content via static middleware?
1. Add static middleware to the [files property](https://github.com/strongloop/loopback-example-middleware/blob/master/server/middleware.json#L17-L19) in middleware.json
2. Delete [`server/boot/root.js`](https://github.com/strongloop/loopback-example-middleware/blob/master/server/boot).
3. Create [`client/index.html`](https://github.com/strongloop/loopback-example-middleware/blob/master/client/index.html)
4. Start the server via `node .` and browse to [`localhost:3000`](http://localhost:3000). You should see `hello world` being served.


#How do you create a custom error message for all errors?
## How do you create a custom error message for all errors?
1. Create a [single function](https://github.com/strongloop/loopback-example-middleware/blob/master/server/server.js#L33-l41) that all errors are passed to.
2. Set [`app.get('remoting').errorHandler`](https://github.com/strongloop/loopback-example-middleware/blob/master/server/server.js#L23-l31) to call a custom error handler.
3. Create a [`custom error middleware`](https://github.com/strongloop/loopback-example-middleware/blob/master/server/middleware/custom-error.js) to handle errors not thrown by the `loopback.rest()` middleware.
Expand Down

0 comments on commit e1ba2a9

Please sign in to comment.