Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
chore(express, express-openapi): bumped versions, housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiisol committed Dec 19, 2022
1 parent 16d5bd7 commit 7209cde
Show file tree
Hide file tree
Showing 6 changed files with 1,364 additions and 33 deletions.
27 changes: 0 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,6 @@ attachControllers(app, [UsersController]);
app.listen(3000);
```


## Another Example of usage
In this example we are using shorter version of Request and Response decorators to typecast them with express Request and Response type.
```typescript
import { Req, Res, Params, Controller, Get, attachControllers } from '@decorators/express';
import {Request,Response} from 'express';
import { Injectable } from '@decorators/di';

@Controller('/')
@Injectable()
class UsersController {

constructor(userService: UserService) {}

@Get('/users/:id')
getData(@Req() req : Request, @Res() res : Response, @Params('id') id: string) {
res.send(this.userService.findById(id));
}
}

let app: Express = express();

attachControllers(app, [UsersController]);

app.listen(3000);
```

## Documentation
Look at the corresponding package for instructions

Expand Down
4 changes: 4 additions & 0 deletions express-openapi/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# TS Files
index.ts
tsconfig.json
src/
Loading

0 comments on commit 7209cde

Please sign in to comment.