Skip to content

Commit

Permalink
support of last screw
Browse files Browse the repository at this point in the history
  • Loading branch information
tikitko committed Jul 11, 2023
1 parent 26b0114 commit 7774dcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion blog-server-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package = "screw-core"
git = "https://github.com/Tikitko/screw.git"
#path = "../../screw/screw-api"
package = "screw-api"
features = ["ws", "json_converter"]
features = ["json"]

[dependencies.screw-ws]
git = "https://github.com/Tikitko/screw.git"
Expand Down
11 changes: 4 additions & 7 deletions blog-server-api/src/router.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::endpoints::*;
use super::extensions::*;
use screw_api::json_converter::*;
use screw_api::json::*;
use screw_api::request::*;
use screw_api::response::*;
use screw_core::request::*;
Expand Down Expand Up @@ -44,13 +44,10 @@ async fn api_not_found_fallback_handler<Extensions>(
pub fn make_router<Extensions: ExtensionsProviderType>(
) -> router::second::Router<Request<Extensions>, Response> {
router::first::Router::with_fallback_handler(not_found_fallback_handler).and_routes(|r| {
r.scoped_convertable(
r.scoped_middleware(
"/api",
routes::Converters {
request_converter: JsonApiRequestConverter,
response_converter: JsonApiResponseConverter {
pretty_printed: cfg!(debug_assertions),
},
JsonApiMiddlewareConverter {
pretty_printed: cfg!(debug_assertions),
},
|r| {
r.scoped("/author", |r| {
Expand Down

0 comments on commit 7774dcb

Please sign in to comment.