Search
 
SCRIPT & CODE EXAMPLE
 

RUST

actix web hello world

use actix_web::{get, post, web, App, HttpRequest, HttpResponse, HttpServer, Responder};

#[get("/")]
async fn hello() -> impl Responder {
    HttpResponse::Ok().body("Hello World")
}

// remains post, patch, put, delete etc requests


#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| App::new().service(hello))
        .bind(("127.0.0.1", 8080))?
        .run()
        .await
}
Comment

PREVIOUS NEXT
Code Example
Rust :: loop rust 
Rust :: rust square root 
Rust :: rust hashmap 
Rust :: rust const string 
Rust :: rust trait 
Rust :: Split text on several separators 
Rust :: find smallest number in vec rust 
Rust :: how to make a sorting algorithim rust 
Rust :: rust comment types 
Rust :: rust lang enum 
Rust :: Repeat the given string exactly n times 
Rust :: Find the next smaller positive integer containing the same digits 
Rust :: armanriazi•rust•unsafe•comparison•references•smartpointers•rawpointer 
Rust :: armanriazi•rust•error•[E0614]: cannot be dereferenced 
Rust :: armanriazi•rust•trait•bound 
Rust :: how to get text from a file and store it in a variable rust 
Rust :: armanriazi•rust•trait•blanket 
Rust :: armanriazi•rust•lifetime•drop 
Lua :: luau make rainbow part 
Lua :: luau make region 
Lua :: luau how to loop through all players 
Lua :: luau table.find 
Lua :: roblox how to get character from player 
Lua :: roblox math.random 
Lua :: print a table in lua 
Lua :: roblox studio pause physics 
Lua :: attempt to call a string value lua 
Lua :: exemple boolean and why it is used 
Lua :: how to detect collision in roblox studio 
Matlab :: matlab pause code run while simulink finishes 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =