Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![feature(async_closure)]
- use actix_web::{web, App, HttpServer, Responder};
- async fn create_diff() {
- std::thread::spawn(async move || {
- println!("123");
- });
- }
- async fn greet() -> impl Responder {
- "Hello"
- }
- #[actix_rt::main]
- async fn main() -> std::io::Result<()> {
- create_diff().await;
- HttpServer::new(|| App::new().route("/", web::get().to(greet)))
- .bind("127.0.0.1:8000")?
- .run()
- .await
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement