✨ Mark async main function with #[pagetop::main]
Also, use #[pagetop::test] for test functions. Add actix-web to Cargo.toml only when using Actix Web macros for service configuration.
This commit is contained in:
parent
4ce59d6520
commit
05304f116a
12 changed files with 58 additions and 21 deletions
|
|
@ -25,7 +25,7 @@ async fn hello_name(
|
|||
.render()
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
#[pagetop::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
Application::prepare(&HelloName).unwrap().run()?.await
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,5 +5,4 @@ edition = "2021"
|
|||
publish = false
|
||||
|
||||
[dependencies]
|
||||
actix-web = "4"
|
||||
pagetop = { version = "0.0", path = "../../../pagetop" }
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ async fn hello_world(request: service::HttpRequest) -> ResultPage<Markup, FatalE
|
|||
.render()
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
#[pagetop::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
Application::prepare(&HelloWorld).unwrap().run()?.await
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue