@@ -17,6 +17,11 @@ If you use `rocket support`.
17
17
[dependencies]
18
18
line-bot-sdk-rust = { version = "0.1", features = ["rocket_support"] }
19
19
```
20
+ If you use ` actix_web support ` .
21
+ ```
22
+ [dependencies]
23
+ line-bot-sdk-rust = { version = "0.1", features = ["actix_support"] }
24
+ ```
20
25
## Configuration
21
26
```
22
27
extern crate line_bot_sdk_rust as line;
@@ -28,39 +33,57 @@ fn main() {
28
33
```
29
34
## How to use
30
35
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
+ ```
33
38
let result: Result<Events, &'static str> =
34
39
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
+ ```
36
52
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 )
47
70
48
71
## Contributing
49
72
Please make a contribution 😆
50
73
51
74
## License
52
75
```
53
- Copyright 2021 nanato12
76
+ Copyright 2021 nanato12
54
77
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
58
81
59
- http://www.apache.org/licenses/LICENSE-2.0
82
+ http://www.apache.org/licenses/LICENSE-2.0
60
83
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