Skip to content

Commit abc03b6

Browse files
committed
documentation updates
1 parent cea8866 commit abc03b6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ api.get('/status', (req,res) => {
2121
})
2222

2323
// Declare your Lambda handler
24-
module.exports.handler = (event, context, callback) => {
24+
exports.handler = async (event, context) => {
2525
// Run the request
26-
api.run(event, context, callback)
26+
return await api.run(event, context)
2727
}
2828
```
2929

@@ -60,7 +60,7 @@ Lambda API was written to be extremely lightweight and built specifically for se
6060
- [error()](#errormessage)
6161
- [etag()](#etagboolean)
6262
- [getHeader()](#getheaderkey)
63-
- [getLink()](#getlinks3path--expires--callback])
63+
- [getLink()](#getlinks3path-expires-callback)
6464
- [hasHeader()](#hasheaderkey)
6565
- [header()](#headerkey-value)
6666
- [html()](#htmlbody)
@@ -381,7 +381,7 @@ Returns a boolean indicating the existence of `key` in the response headers. `ke
381381
### removeHeader(key)
382382
Removes header matching `key` from the response headers. `key` is case insensitive. This method is chainable.
383383

384-
### getLink(s3Path [,expires] [,callback])
384+
### getLink(s3Path [, expires] [, callback])
385385
This returns a signed URL to the referenced file in S3 (using the `s3://{my-bucket}/{path-to-file}` format). You can optionally pass in an integer as the second parameter that will changed the default expiration time of the link. The expiration time is in seconds and defaults to `900`. In order to ensure proper URL signing, the `getLink()` must be asynchronous, and therefore returns a promise. You must either `await` the result or use a `.then` to retrieve the value.
386386

387387
There is an optional third parameter that takes an error handler callback. If the underlying `getSignedUrl()` call fails, the error will be returned using the standard `res.error()` method. You can override this by providing your own callback.
@@ -576,7 +576,7 @@ res.clearCookie('fooArray', { path: '/', httpOnly: true }).send()
576576
### etag([boolean])
577577
Enables Etag generation for the response if at value of `true` is passed in. Lambda API will generate an Etag based on the body of the response and return the appropriate header. If the request contains an `If-No-Match` header that matches the generated Etag, a `304 Not Modified` response will be returned with a blank body.
578578

579-
### cache([age] [,private])
579+
### cache([age] [, private])
580580
Adds `cache-control` header to responses. If the first parameter is an `integer`, it will add a `max-age` to the header. The number should be in milliseconds. If the first parameter is `true`, it will add the cache headers with `max-age` set to `0` and use the current time for the `expires` header. If set to false, it will add a cache header with `no-cache, no-store, must-revalidate` as the value. You can also provide a custom string that will manually set the value of the `cache-control` header. And optional second argument takes a `boolean` and will set the `cache-control` to `private` This method is chainable.
581581

582582
```javascript

0 commit comments

Comments
 (0)