mirror of
https://github.com/actix/actix-website
synced 2024-11-27 18:12:57 +01:00
65 lines
1.9 KiB
HTML
65 lines
1.9 KiB
HTML
|
{{ partial "header" . }}
|
||
|
|
||
|
<div class="jumbotron">
|
||
|
<div class="actix-jumbotron">
|
||
|
<img src="/img/logo-large.png" class="align-middle actix-logo" alt="">
|
||
|
<p class="lead">rust's powerful actor system and most fun web framework</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="container actix-home">
|
||
|
<div class="row">
|
||
|
<div class="col-md-4">
|
||
|
<div class="actix-features">
|
||
|
<h2>
|
||
|
<i class="fa fa-fw fa-shield" aria-hidden="true"></i>
|
||
|
Type Safe
|
||
|
</h2>
|
||
|
<p>Forget about stringly typed objects, from request to response, everything has types.</p>
|
||
|
|
||
|
<h2>
|
||
|
<i class="fa fa-fw fa-battery-full" aria-hidden="true"></i>
|
||
|
Feature Rich
|
||
|
</h2>
|
||
|
<p>Actix provides a lot of features out of box. WebSockets, HTTP/2, pipelining etc.</p>
|
||
|
|
||
|
<h2>
|
||
|
<i class="fa fa-fw fa-puzzle-piece" aria-hidden="true"></i>
|
||
|
Extensible
|
||
|
</h2>
|
||
|
<p>Easily create your own libraries that any Actix application can use.</p>
|
||
|
|
||
|
<h2>
|
||
|
<i class="fa fa-fw fa-dashboard" aria-hidden="true"></i>
|
||
|
Blazingly Fast
|
||
|
</h2>
|
||
|
<p>Actix is blazingly fast. <a href="https://www.techempower.com/benchmarks/#section=data-r15&hw=ph&test=fortune">Check yourself</a>.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="col-md-8">
|
||
|
<div class="actix-content">
|
||
|
{{ highlight `extern crate actix_web;
|
||
|
use actix_web::{server, App, HttpRequest, Responder};
|
||
|
|
||
|
fn greet(req: HttpRequest) -> impl Responder {
|
||
|
let to = req.match_info().get("name").unwrap_or("World");
|
||
|
format!("Hello {}!", to)
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
server::new(|| {
|
||
|
App::new()
|
||
|
.resource("/", |r| r.f(greet))
|
||
|
.resource("/{name}", |r| r.f(greet))
|
||
|
})
|
||
|
.bind("127.0.0.1:8000")
|
||
|
.expect("Can not bind to port 8000")
|
||
|
.run();
|
||
|
}` "rust" "" }}
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
{{ partial "footer" . }}
|