main.rs738 chars33 lines
In the above code snippet, a HttpServer
is created using the actix-web
crate. A route is created for the root path ("/") which accepts only HTTP POST method. The incoming JSON request is deserialized using serde
and stored in a struct called RequestBody
. A JSON response is then sent back with the message received in the request body.
gistlibby LogSnag