-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add actix-web v3 support * Add actix-web example * Resolve changelog PR number * Make sure that examples are built on CI * Format Cargo.toml consistently Co-authored-by: Chris Wong <[email protected]>
- Loading branch information
1 parent
b3d16f8
commit 31115a6
Showing
5 changed files
with
36 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// do not use this line in your application | ||
use actix_web_dep as actix_web; | ||
|
||
use actix_web::{get, App, HttpServer, Result as AwResult}; | ||
use maud::{html, Markup}; | ||
use std::io; | ||
|
||
#[get("/")] | ||
async fn index() -> AwResult<Markup> { | ||
Ok(html! { | ||
html { | ||
body { | ||
h1 { "Hello World!" } | ||
} | ||
} | ||
}) | ||
} | ||
|
||
#[actix_web::main] | ||
async fn main() -> io::Result<()> { | ||
HttpServer::new(|| App::new().service(index)) | ||
.bind(("127.0.0.1", 8080))? | ||
.run() | ||
.await | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters