Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Commit

Permalink
chore:Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis committed May 8, 2020
1 parent 14b8247 commit cbd4c94
Show file tree
Hide file tree
Showing 101 changed files with 2 additions and 1,567 deletions.
35 changes: 0 additions & 35 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,3 @@

> HTTP Exceptions for REST API based on Express.js
See [guide installation](getting-started.md) and our [API](api/index.md)

## Example

```typescript
import {BadRequest, Exception} from 'ts-httpexceptions';
let express = require('express');
let app = express();

app.get('/my/route', (req, res) => {

throw new BadRequest('Custom Message'); //Emit
// OR
// throw new Exception(510, 'Custom Message');

});

app.get('/my/route/params', (req, res) => {

if (req.params.id === undefined){
throw new BadRequest();
}

});


//GlobalHandler middleware catch exception and send response to the client
app.use((err, request, response) => {

if(err instanceof Exception){
response.status(err.status).send(err.message);
}

});
```
4 changes: 2 additions & 2 deletions docs/_coverpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
- Extensible
- ES6/Typescript

[GitHub](https://github.com/TypeProject/ts-httpexceptions/)
[Get Started](#tshttpexceptions)
[GitHub](https://github.com/TypedProject/tsed/)
[Get Started](https://tsed.io/docs/exceptions.html)

2 changes: 0 additions & 2 deletions docs/_navbar.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@

- <div class="ps-icon ps-icon-arrow-right"></div> [Getting started](getting-started.md)
- <div class="ps-icon ps-icon-puzzle"></div> [API references](api/index.md)

4 changes: 0 additions & 4 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
* [<div class="ps-icon ps-icon-arrow-right"></div> Getting started](getting-started.md)
* [<div class="ps-icon ps-icon-puzzle"></div> API references](api/index.md)
* [<div class="ps-icon ps-icon-github-alt"></div> Contributing](contributing.md)
* [<div class="ps-icon ps-icon-file"></div> License](license.md)
16 changes: 0 additions & 16 deletions docs/api/common/badgateway.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/api/common/badmapping.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/api/common/badrequest.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/api/common/bandwidthlimitexceeded.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/api/common/clientErrors/badmapping.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/api/common/clientErrors/badrequest.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/api/common/clientErrors/conflict.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/api/common/clientErrors/expectationfailed.md

This file was deleted.

0 comments on commit cbd4c94

Please sign in to comment.