Skip to content

Commit

Permalink
fix(dependencies): aws sdk v3 packages are dependencies not devDepend…
Browse files Browse the repository at this point in the history
…encies (#231)

* fix(dependencies): aws sdk v3 packages are dependencies not devDependencies

* fix(failing-ci): run prettier in code

* fix(package-json): change deps to peerDeps

* feat(github-actions): add custom NPM version for all node versions

* fix(github-actions): bash and command
  • Loading branch information
oieduardorabelo authored Mar 12, 2023
1 parent cea86cf commit fd4bda0
Show file tree
Hide file tree
Showing 4 changed files with 236 additions and 221 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
pull_request:
types: [opened, reopened, synchronize]

env:
NPM_VERSION: latest

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -19,6 +22,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install latest npm
run: |
npm install -g npm@$NPM_VERSION &&
npm --version &&
npm list -g --depth 0
- name: Install dependencies
run: npm ci
- name: Install dependencies
run: npm ci
- name: Run tests
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,21 +486,22 @@ res.sendStatus(403); // equivalent to res.status(403).send('Forbidden')
The `header` method allows for you to set additional headers to return to the client. By default, just the `content-type` header is sent with `application/json` as the value. Headers can be added or overwritten by calling the `header()` method with two string arguments. The first is the name of the header and then second is the value. You can utilize multi-value headers by specifying an array with multiple values as the `value`, or you can use an optional third boolean parameter and append multiple headers.

```javascript
api.get('/users', (req,res) => {
res.header('content-type','text/html').send('<div>This is HTML</div>')
})
api.get('/users', (req, res) => {
res.header('content-type', 'text/html').send('<div>This is HTML</div>');
});

// Set multiple header values
api.get('/users', (req,res) => {
res.header('someHeader',['foo','bar']).send({})
})
api.get('/users', (req, res) => {
res.header('someHeader', ['foo', 'bar']).send({});
});

// Set multiple header by adding to existing header
api.get('/users', (req,res) => {
res.header('someHeader','foo')
.header('someHeader','bar',true) // append another value
.send({})
})
api.get('/users', (req, res) => {
res
.header('someHeader', 'foo')
.header('someHeader', 'bar', true) // append another value
.send({});
});
```

**NOTE:** Header keys are converted and stored as lowercase in compliance with [rfc7540 8.1.2. HTTP Header Fields](https://tools.ietf.org/html/rfc7540) for HTTP/2. Header convenience methods (`getHeader`, `hasHeader`, and `removeHeader`) automatically ignore case.
Expand Down
Loading

0 comments on commit fd4bda0

Please sign in to comment.