mirror of
https://github.com/actix/actix-website
synced 2025-06-27 07:29:02 +02:00
Minor wording recommendations (#184)
Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
// <config>
|
||||
use actix_web::{web, App, HttpResponse, HttpServer};
|
||||
|
||||
// this function could be located in different module
|
||||
// this function could be located in a different module
|
||||
fn scoped_config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(
|
||||
web::resource("/test")
|
||||
@ -10,7 +10,7 @@ fn scoped_config(cfg: &mut web::ServiceConfig) {
|
||||
);
|
||||
}
|
||||
|
||||
// this function could be located in different module
|
||||
// this function could be located in a different module
|
||||
fn config(cfg: &mut web::ServiceConfig) {
|
||||
cfg.service(
|
||||
web::resource("/app")
|
||||
|
@ -37,6 +37,7 @@ async fn _main() -> std::io::Result<()> {
|
||||
HttpServer::new(move || {
|
||||
// move counter into the closure
|
||||
App::new()
|
||||
// Note: using app_data instead of data
|
||||
.app_data(counter.clone()) // <- register the created data
|
||||
.route("/", web::get().to(_index))
|
||||
})
|
||||
|
Reference in New Issue
Block a user