Skip to content

Commit

Permalink
feat(contentType): add ability to define content type
Browse files Browse the repository at this point in the history
  • Loading branch information
satblip committed Mar 2, 2022
1 parent 818a412 commit f12a6de
Show file tree
Hide file tree
Showing 4 changed files with 3,850 additions and 57 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ module.exports = {

#### Return behaviors

- If you return an object without `redirect` key in it, it will respond JSON
- If you return an object with `redirect` key in it, it will redirect to the value
- If you return an object without `barabara.redirect` key in it, it will respond normally
- If you return an object with `barabara.redirect` key in it, it will redirect to the value
- If you return an object with `barabara.contentType` and a `buffer`, it will respond with the right `Content-Type` header
- If you return a non-object, it will respond this non-object (html for example)


*Note: not all the methods need to be implemented*

`req.query`, `req.body`, `req.params` will be merged in `params` (in this order).
Expand Down
Loading

0 comments on commit f12a6de

Please sign in to comment.