2019-06-17 08:08:42 +02:00
|
|
|
use actix_web::{guard, web, App, HttpResponse};
|
2018-05-24 19:13:55 +02:00
|
|
|
|
2019-06-26 00:20:36 +02:00
|
|
|
#[rustfmt::skip]
|
2019-12-28 20:10:02 +01:00
|
|
|
#[actix_rt::main]
|
|
|
|
async fn main() -> std::io::Result<()> {
|
2019-06-26 00:20:36 +02:00
|
|
|
use actix_web::HttpServer;
|
|
|
|
|
|
|
|
HttpServer::new(|| {
|
|
|
|
// <cfg>
|
|
|
|
App::new().service(
|
|
|
|
web::resource("/path").route(
|
|
|
|
web::route()
|
|
|
|
.guard(guard::Get())
|
|
|
|
.guard(guard::Header("content-type", "text/plain"))
|
|
|
|
.to(|| HttpResponse::Ok()),
|
|
|
|
),
|
|
|
|
)
|
2018-05-24 19:13:55 +02:00
|
|
|
// </cfg>
|
2019-06-26 00:20:36 +02:00
|
|
|
})
|
2019-12-28 20:10:02 +01:00
|
|
|
.bind("127.0.0.1:8088")?
|
2019-06-26 00:20:36 +02:00
|
|
|
.run()
|
2019-12-28 20:10:02 +01:00
|
|
|
.await
|
2019-06-26 00:20:36 +02:00
|
|
|
}
|