Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed Feb 17, 2020
1 parent b2ee7d0 commit 189c0a9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ new OpenApiValidator({
x-eov-operation-id: ping
```
- Finally, use the `x-eov-operation-handler` OpenAPI vendor extension to specify a path (relative to `operationHandlers`) to the module that contains the handler for this operation.
- Next, use the `x-eov-operation-handler` OpenAPI vendor extension to specify a path (relative to `operationHandlers`) to the module that contains the handler for this operation.

```yaml
/ping:
Expand All @@ -197,6 +197,15 @@ new OpenApiValidator({
x-eov-operation-handler: routes/ping # no .js or .ts extension
```

- Finally, create the express handler module e.g. `routes/ping.js`

```javascript
module.exports = {
// the express handler implementaiton for ping
ping: (req, res) => res.status(200).send('pong'),
};
```


**Note:** A file may contain *one* or *many* handlers.

Expand Down

0 comments on commit 189c0a9

Please sign in to comment.