Skip to content

Commit

Permalink
docs: added README.md and flow chart
Browse files Browse the repository at this point in the history
  • Loading branch information
syncush committed Jan 12, 2021
1 parent b00a8c8 commit 9079d10
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# error-express-handler

error-express-handler
This package exports a middleware for express that handles Error and HttpError(custom package type).
## Install
```sh
npm install --save @map-colonies/error-express-handler
```

## Usage


```ts
import express from 'express';
import { getErrorHandlerMiddleware } from '@map-colonies/error-express-handler';

process.env.NODE_ENV = 'development';

const app = express();

app.use('/meow', fn);

app.use(getErrorHandlerMiddleware((message) => console.error(message)));

app.listen(8080, function() {
console.log('server is up');
});
```

## Flow
![Flow of package](docs/flow.png)
Binary file added docs/flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9079d10

Please sign in to comment.