Skip to content

Commit

Permalink
upgrade to ntex 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leon3s committed Jan 10, 2024
1 parent 802a04c commit fd15120
Show file tree
Hide file tree
Showing 24 changed files with 30 additions and 37 deletions.
2 changes: 1 addition & 1 deletion examples/application/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ edition = "2018"
workspace = "../"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
2 changes: 1 addition & 1 deletion examples/async-handlers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "2.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
futures = "0.3.1"
bytes = "0.5"
2 changes: 1 addition & 1 deletion examples/databases/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
diesel = { version = "2", features = ["sqlite", "r2d2"] }
serde = { version = "1", features = ["derive"] }
uuid = { version = "1", features = ["v4"] }
2 changes: 1 addition & 1 deletion examples/either/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
2 changes: 1 addition & 1 deletion examples/errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
derive_more = "0.99"
env_logger = "0.7"
log = "0.4"
2 changes: 1 addition & 1 deletion examples/extractors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
serde = "1.0"
serde_json = "1.0"
2 changes: 1 addition & 1 deletion examples/flexible-responders/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
serde = "1.0"
2 changes: 1 addition & 1 deletion examples/getting-started/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ edition = "2018"
workspace = "../"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
2 changes: 1 addition & 1 deletion examples/http2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio", "openssl"] }
ntex = { version = "1.0.0", features = ["tokio", "openssl"] }
openssl = { version = "0.10", features = ["v110", "vendored"] }
2 changes: 1 addition & 1 deletion examples/main-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
4 changes: 2 additions & 2 deletions examples/middleware/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio", "cookie"] }
ntex-session = { version = "0.4.0-b.0" }
ntex = { version = "1.0.0", features = ["tokio", "cookie"] }
ntex-session = { version = "0.4.0" }
futures-util = { version = "0.3.7", default-features = false, features = ["std"] }
env_logger = "0.10.0"
5 changes: 1 addition & 4 deletions examples/middleware/src/errorhandler.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![allow(dead_code)]

use futures_util::Future;
// <error-handler>
use ntex::http::header;
use ntex::service::{Middleware, Service, ServiceCtx};
Expand Down Expand Up @@ -30,8 +29,7 @@ where

ntex::forward_poll_ready!(service);

fn call(&self, req: web::WebRequest<Err>, ctx: ServiceCtx<Self>) -> impl Future<Output = Result<Self::Response, Self::Error>> {
Box::pin(async move {
async fn call<'a>(&self, req: web::WebRequest<Err>, ctx: ServiceCtx<'a, Self>) -> Result<Self::Response, Self::Error> {
ctx.call(&self.service, req).await.map(|mut res| {
let status = res.status();
if status.is_client_error() || status.is_server_error() {
Expand All @@ -42,7 +40,6 @@ where
}
res
})
})
}
}

Expand Down
12 changes: 4 additions & 8 deletions examples/middleware/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pub mod errorhandler;
pub mod logger;
pub mod user_sessions;

use futures_util::Future;
// <simple>
use ntex::service::{Middleware, Service, ServiceCtx};
use ntex::web;
Expand Down Expand Up @@ -36,14 +35,11 @@ where

ntex::forward_poll_ready!(service);

fn call(&self, req: web::WebRequest<Err>, ctx: ServiceCtx<Self>) -> impl Future<Output = Result<Self::Response, Self::Error>> {
async fn call<'a>(&self, req: web::WebRequest<Err>, ctx: ServiceCtx<'a, Self>) -> Result<Self::Response, Self::Error> {
println!("Hi from start. You requested: {}", req.path());
Box::pin(async move {
let fut = ctx.call(&self.service, req);
let res = fut.await?;
println!("Hi from response");
Ok(res)
})
let res = ctx.call(&self.service, req).await?;
println!("Hi from response");
Ok(res)
}
}
// </simple>
Expand Down
2 changes: 1 addition & 1 deletion examples/powerful-extractors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
serde = "1.0"
2 changes: 1 addition & 1 deletion examples/request-handlers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
2 changes: 1 addition & 1 deletion examples/request-routing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
4 changes: 2 additions & 2 deletions examples/requests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ edition = "2018"
[dependencies]
serde = "1.0"
serde_json = "1.0"
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
futures = "0.3.1"
ntex-multipart = "0.4.0-b.0"
ntex-multipart = "0.4.0"
2 changes: 1 addition & 1 deletion examples/responses/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio", "compress"] }
ntex = { version = "1.0.0", features = ["tokio", "compress"] }
serde = "1.0"
futures = "0.3.1"
bytes = "0.5"
2 changes: 1 addition & 1 deletion examples/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ workspace = "../"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio", "openssl"] }
ntex = { version = "1.0.0", features = ["tokio", "openssl"] }
futures = "0.3"
openssl = { version = "0.10", features = ["vendored"] }
tokio = { version = "1.16.1", features = ["full"] }
4 changes: 2 additions & 2 deletions examples/static-files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex-files = "0.4.0-b.0"
ntex = { version = "1.0.0", features = ["tokio"] }
ntex-files = "0.4.0"
mime = "0.3"
2 changes: 1 addition & 1 deletion examples/testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.0.0"
edition = "2018"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
futures = "0.3"
futures-util = "0.3"
bytes = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion examples/url-dispatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2018"
workspace = "../"

[dependencies]
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
futures = "0.3.1"
openssl = "0.10"
serde = "1.0"
2 changes: 1 addition & 1 deletion examples/websockets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ edition = "2018"

[dependencies]
futures = "0.3.27"
ntex = { version = "1.0.0-b.1", features = ["tokio"] }
ntex = { version = "1.0.0", features = ["tokio"] }
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ntex-website",
"version": "1.0.1",
"version": "1.1.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down

0 comments on commit fd15120

Please sign in to comment.