4 releases

0.1.3 Feb 24, 2021
0.1.2 Feb 24, 2021
0.1.1 Feb 24, 2021
0.1.0 Apr 10, 2020

#101 in #websockets

Download history 693/week @ 2023-10-19 829/week @ 2023-10-26 1058/week @ 2023-11-02 906/week @ 2023-11-09 967/week @ 2023-11-16 1069/week @ 2023-11-23 851/week @ 2023-11-30 957/week @ 2023-12-07 991/week @ 2023-12-14 842/week @ 2023-12-21 757/week @ 2023-12-28 1294/week @ 2024-01-04 800/week @ 2024-01-11 732/week @ 2024-01-18 719/week @ 2024-01-25 591/week @ 2024-02-01

2,983 downloads per month
Used in 42 crates (2 directly)

MIT license

17KB
350 lines

Macros for ntex::web framework Build Status


lib.rs:

ntex macros module

Generators for routes

Route

Macros:

Attributes:

  • "path" - Raw literal string with path for which to register handle. Mandatory.
  • guard = "function_name" - Registers function as guard using ntex::web::guard::fn_guard
  • error = "ErrorRenderer" - Register handler for specified error renderer

Notes

Function name can be specified as any expression that is going to be accessible to the generate code (e.g my_guard or my_module::my_guard)

Example:

use ntex::web::{get, Error, HttpResponse};
use futures::{future, Future};

#[get("/test")]
async fn async_test() -> Result<HttpResponse, Error> {
    Ok(HttpResponse::Ok().finish())
}

Dependencies

~1.5MB
~32K SLoC