Skip to content

Commit fde7c8e

Browse files
committed
Rename
1 parent d411b6a commit fde7c8e

File tree

12 files changed

+46
-29
lines changed

12 files changed

+46
-29
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ Cargo.lock
4444
### Others ###
4545
.halt.releez.yml
4646
/.idea
47-
json-response.iml
47+
routerify-json-response.iml
4848

4949
# End of https://www.gitignore.io/api/rust,macos

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
2-
name = "json-response"
2+
name = "routerify-json-response"
33
version = "1.0.0"
4-
description = "A utility library to send JSON response for Routerify and hyper.rs apps."
5-
homepage = "https://github.com/routerify/json-response"
6-
repository = "https://github.com/routerify/json-response"
4+
description = "A Routerify utility library to generate JSON response."
5+
homepage = "https://github.com/routerify/routerify-json-response"
6+
repository = "https://github.com/routerify/routerify-json-response"
77
keywords = ["routerify", "hyper-rs", "json", "response"]
88
categories = ["asynchronous", "web-programming", "web-programming::http-server"]
99
authors = ["Rousan Ali <[email protected]>"]

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
[![Github Actions Status](https://github.com/routerify/json-response/workflows/Test/badge.svg)](https://github.com/routerify/json-response/actions)
2-
[![crates.io](https://img.shields.io/crates/v/json-response.svg)](https://crates.io/crates/json-response)
3-
[![Documentation](https://docs.rs/json-response/badge.svg)](https://docs.rs/json-response)
4-
[![MIT](https://img.shields.io/crates/l/json-response.svg)](./LICENSE)
1+
[![Github Actions Status](https://github.com/routerify/routerify-json-response/workflows/Test/badge.svg)](https://github.com/routerify/routerify-json-response/actions)
2+
[![crates.io](https://img.shields.io/crates/v/routerify-json-response.svg)](https://crates.io/crates/routerify-json-response)
3+
[![Documentation](https://docs.rs/routerify-json-response/badge.svg)](https://docs.rs/routerify-json-response)
4+
[![MIT](https://img.shields.io/crates/l/routerify-json-response.svg)](./LICENSE)
55

6-
# json-response
6+
# routerify-json-response
77

8-
A utility library to send JSON response for [`Routerify`](https://github.com/routerify/routerify) and the Rust HTTP library [`hyper.rs`](https://hyper.rs/) apps.
8+
A [`Routerify`](https://github.com/routerify/routerify) utility library to generate JSON response.
99

1010
In `Success` case, It generates JSON response in the following format:
1111

@@ -27,7 +27,7 @@ In `Failed` case, It generates JSON response in the following format:
2727
}
2828
```
2929

30-
[Docs](https://docs.rs/json-response)
30+
[Docs](https://docs.rs/routerify-json-response)
3131

3232
## Install
3333

@@ -36,15 +36,15 @@ Add this to your `Cargo.toml`:
3636
```toml
3737
[dependencies]
3838
routerify = "1.0"
39-
json-response = "1.0"
39+
routerify-json-response = "1.0"
4040
```
4141

4242
## Example
4343

4444
```rust
4545
use hyper::{Body, Request, Response, Server, StatusCode};
46-
// Import required json_response methods.
47-
use json_response::{json_failed_resp_with_message, json_success_resp};
46+
// Import required routerify_json_response methods.
47+
use routerify_json_response::{json_failed_resp_with_message, json_success_resp};
4848
use routerify::{Router, RouterService};
4949
use std::net::SocketAddr;
5050

examples/example.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use hyper::{Body, Request, Response, Server, StatusCode};
2-
// Import required json_response methods.
3-
use json_response::{json_failed_resp_with_message, json_success_resp};
2+
// Import required routerify_json_response methods.
43
use routerify::{Router, RouterService};
4+
use routerify_json_response::{json_failed_resp_with_message, json_success_resp};
55
use std::net::SocketAddr;
66

77
async fn list_users_handler(_: Request<Body>) -> Result<Response<Body>, routerify::Error> {

examples/test.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use hyper::{Body, Request, Response, Server, StatusCode};
2-
use json_response::{json_failed_resp, json_failed_resp_with_message, json_success_resp, json_success_resp_with_code};
32
use routerify::{Router, RouterService};
3+
use routerify_json_response::{
4+
json_failed_resp, json_failed_resp_with_message, json_success_resp, json_success_resp_with_code,
5+
};
46
use std::{convert::Infallible, net::SocketAddr};
57

68
async fn home_handler(_: Request<Body>) -> Result<Response<Body>, Infallible> {

examples/test_stream_body.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use hyper::{Body as HyperBody, Request, Response, Server, StatusCode};
2-
use json_response::{json_failed_resp, json_failed_resp_with_message, json_success_resp, json_success_resp_with_code};
32
use routerify::{Router, RouterService};
3+
use routerify_json_response::{
4+
json_failed_resp, json_failed_resp_with_message, json_success_resp, json_success_resp_with_code,
5+
};
46
use std::{convert::Infallible, net::SocketAddr};
57
use stream_body::StreamBody;
68

json-response.iml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="RUST_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
<sourceFolder url="file://$MODULE_DIR$/examples" isTestSource="false" />
8+
<excludeFolder url="file://$MODULE_DIR$/target" />
9+
</content>
10+
<orderEntry type="inheritedJdk" />
11+
<orderEntry type="sourceFolder" forTests="false" />
12+
</component>
13+
</module>

releez.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ checklist:
4444
- name: Edit tag on Github
4545
type: manual
4646
instructions:
47-
- Tag is pushed to Github(https://github.com/routerify/json-response/releases). Edit it there and make it a release.
47+
- Tag is pushed to Github(https://github.com/routerify/routerify-json-response/releases). Edit it there and make it a release.
4848
- name: Publish to crates.io
4949
type: auto
5050
confirm: Are you sure to publish it to crates.io?

src/failed_resp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct FailedResp {
2828
///
2929
/// ```
3030
/// use hyper::{Body, Request, Response, StatusCode};
31-
/// use json_response::{json_failed_resp_with_message};
31+
/// use routerify_json_response::{json_failed_resp_with_message};
3232
///
3333
/// async fn list_books_handler(_: Request<Body>) -> Result<Response<Body>, routerify::Error> {
3434
/// // Generate a failed JSON response in the following format:
@@ -69,7 +69,7 @@ where
6969
///
7070
/// ```
7171
/// use hyper::{Body, Request, Response, StatusCode};
72-
/// use json_response::{json_failed_resp};
72+
/// use routerify_json_response::{json_failed_resp};
7373
///
7474
/// async fn list_books_handler(_: Request<Body>) -> Result<Response<Body>, routerify::Error> {
7575
/// // Generate a failed JSON response in the following format:

src/gen_resp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ where
1010
Ok(json_data) => json_data,
1111
Err(err) => {
1212
return Err(routerify::Error::new(format!(
13-
"json-response: Failed to convert the response data as JSON: {}",
13+
"routerify-json-response: Failed to convert the response data as JSON: {}",
1414
err
1515
)));
1616
}
@@ -28,7 +28,7 @@ where
2828
match resp {
2929
Ok(resp) => Ok(resp),
3030
Err(err) => Err(routerify::Error::new(format!(
31-
"json-response: Failed to create response: {}",
31+
"routerify-json-response: Failed to create response: {}",
3232
err
3333
))),
3434
}

0 commit comments

Comments
 (0)