Skip to content

Commit c4f7f10

Browse files
committed
Update README.md
1 parent 71062ae commit c4f7f10

File tree

1 file changed

+47
-24
lines changed

1 file changed

+47
-24
lines changed

README.md

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ If you use `rocket support`.
1717
[dependencies]
1818
line-bot-sdk-rust = { version = "0.1", features = ["rocket_support"] }
1919
```
20+
If you use `actix_web support`.
21+
```
22+
[dependencies]
23+
line-bot-sdk-rust = { version = "0.1", features = ["actix_support"] }
24+
```
2025
## Configuration
2126
```
2227
extern crate line_bot_sdk_rust as line;
@@ -28,39 +33,57 @@ fn main() {
2833
```
2934
## How to use
3035
The LINE Messaging API uses the JSON data format.
31-
parse_event_request() will help you to parse the HttpRequest content and return a Result<[Events](`events::Events`) , &'static str> Object.
32-
```
36+
parse_event_request() will help you to parse the HttpRequest content and return a Result<[Events](`events::Events`) , &'static str> Object.
37+
```
3338
let result: Result<Events, &'static str> =
3439
bot.parse_event_request(signature, body);
35-
```
40+
```
41+
42+
```
43+
match result {
44+
Ok(events) => {
45+
for event in events.events {
46+
...
47+
}
48+
}
49+
Err(msg) => {}
50+
}
51+
```
3652

37-
```
38-
match result {
39-
Ok(events) => {
40-
for event in events.events {
41-
...
42-
}
43-
}
44-
Err(msg) => {}
45-
}
46-
```
53+
## EchoBot examples
54+
55+
**with Rocket framework**
56+
57+
```bash
58+
cargo run --example echobot_rocket --features=rocket_support
59+
```
60+
61+
source: [rocket example](./examples/echobot_rocket.rs)
62+
63+
**with Actix_web framework**
64+
65+
```bash
66+
cargo run --example echobot_actix_web --features=actix_support
67+
```
68+
69+
source: [actix_web example](./examples/echobot_actix_web.rs)
4770

4871
## Contributing
4972
Please make a contribution 😆
5073

5174
## License
5275
```
53-
Copyright 2021 nanato12
76+
Copyright 2021 nanato12
5477
55-
Licensed under the Apache License, Version 2.0 (the "License");
56-
you may not use this file except in compliance with the License.
57-
You may obtain a copy of the License at
78+
Licensed under the Apache License, Version 2.0 (the "License");
79+
you may not use this file except in compliance with the License.
80+
You may obtain a copy of the License at
5881
59-
http://www.apache.org/licenses/LICENSE-2.0
82+
http://www.apache.org/licenses/LICENSE-2.0
6083
61-
Unless required by applicable law or agreed to in writing, software
62-
distributed under the License is distributed on an "AS IS" BASIS,
63-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
64-
See the License for the specific language governing permissions and
65-
limitations under the License.
66-
```
84+
Unless required by applicable law or agreed to in writing, software
85+
distributed under the License is distributed on an "AS IS" BASIS,
86+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
87+
See the License for the specific language governing permissions and
88+
limitations under the License.
89+
```

0 commit comments

Comments
 (0)