mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
v3 examples (#364)
This commit is contained in:
@ -8,6 +8,7 @@ use actix_web::*;
|
||||
pub struct MyObj {
|
||||
#[prost(int32, tag = "1")]
|
||||
pub number: i32,
|
||||
|
||||
#[prost(string, tag = "2")]
|
||||
pub name: String,
|
||||
}
|
||||
@ -17,7 +18,7 @@ async fn index(msg: ProtoBuf<MyObj>) -> Result<HttpResponse> {
|
||||
HttpResponse::Ok().protobuf(msg.0) // <- send response
|
||||
}
|
||||
|
||||
#[actix_rt::main]
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
std::env::set_var("RUST_LOG", "actix_web=debug,actix_server=info");
|
||||
env_logger::init();
|
||||
|
Reference in New Issue
Block a user