Skip to content

Commit

Permalink
Fix broken links in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tokuhirom committed Mar 26, 2024
1 parent 0d7d57c commit c2c98d0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 33 deletions.
22 changes: 0 additions & 22 deletions docs/api-reference.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/getting-started/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ app.listen(3000);
The full examples with comments can be found
in [examples](https://github.com/line/line-bot-sdk-nodejs/tree/master/examples/).

For the specifications of API, please refer to [API Reference](../api-reference.md).
For the specifications of API, please refer to [API Reference](../apidocs/modules.md).
6 changes: 3 additions & 3 deletions docs/guide/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Client is to send messages, get user or content information, or leave chats.
A client instance provides functions for [messaging APIs](https://developers.line.biz/en/reference/messaging-api/),
so that you do not need to worry about HTTP requests and can focus on data.
For type signatures of the methods, please refer to [its API reference](../api-reference/client.md).
For type signatures of the methods, please refer to [its API reference](../apidocs/modules.md).

## Create a client

Expand Down Expand Up @@ -124,5 +124,5 @@ stream.on('error', (err) => {
```

You can check which method returns `Promise` or `ReadableStream` in the API
reference of [`Client`](../api-reference/client.md). For type signatures of the
errors above, please refer to [Exceptions](../api-reference/exceptions.md).
reference of [`Client`](../apidocs/modules.md). For type signatures of the
errors above, please refer to [Exceptions](../apidocs/modules.md).
12 changes: 5 additions & 7 deletions docs/guide/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ of the official document.
**Signature validation** is checking if a request is actually sent from real
LINE servers, not a fraud. The validation is conducted by checking
the [X-Line-Signature](https://developers.line.biz/en/reference/messaging-api/#signature-validation) header
and request body. There is a [`validateSignature()`](../api-reference/validate-signature.md)
function to do this.
and request body. There is a `validateSignature()` function to do this.

**Webhook event object parsing** is literally parsing webhook event objects,
which contains information of each webhook event. The objects are provided as
request body in JSON format, so any body parser will work here. For interal
object types in this SDK, please refer to [Message and event objects](../api-reference/message-and-event-objects.md).
request body in JSON format, so any body parser will work here.

There is a function to generate a [connect](https://github.com/senchalabs/connect) middleware,
[`middleware()`](../api-reference/middleware.md), to conduct both of them. If
[`middleware()`](https://github.com/line/line-bot-sdk-nodejs/blob/master/lib/middleware.ts), to conduct both of them. If
your server can make use of connect middlewares, such as [Express](https://expressjs.com/),
using the middleware is a recommended way to build a webhook server.

Expand Down Expand Up @@ -115,7 +113,7 @@ However, there are environments where `req.body` is pre-parsed, such as
[Firebase Cloud Functions](https://firebase.google.com/docs/functions/http-events).
If it parses the body into string or buffer, the middleware will use the body
as it is and work just fine. If the pre-parsed body is an object, the webhook
middleware will fail to work. In the case, please use [`validateSignature()`](../api-reference/validate-signature.md)
middleware will fail to work. In the case, please use [`validateSignature()`](https://github.com/line/line-bot-sdk-nodejs/blob/0d7d57c311d582e5de4560d136e04a73da85a249/lib/validate-signature.ts)
manually with raw body.

## Error handling
Expand All @@ -127,7 +125,7 @@ and the other is `JSONParseError`.
- `SignatureValidationFailed` is thrown when a request has a wrong signature.
- `JSONParseError` occurs when a request body cannot be parsed as JSON.

For type references of the errors, please refer to [the API reference](../api-reference/exceptions.md).
For type references of the errors, please refer to [the API reference](../apidocs/modules.md).

The errors can be handled with [error middleware](https://github.com/senchalabs/connect#error-middleware).

Expand Down

0 comments on commit c2c98d0

Please sign in to comment.