dotenv thingy
This commit is contained in:
@@ -1,9 +1,5 @@
|
|||||||
use actix_web::{get, post, web, App, HttpResponse, HttpServer, Responder};
|
use actix_web::{get, post, web, App, HttpResponse, HttpServer, Responder};
|
||||||
|
use dotenv::dotenv;
|
||||||
#[get("/")]
|
|
||||||
async fn hello() -> impl Responder {
|
|
||||||
HttpResponse::Ok().body("Hello world!")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[post("/echo")]
|
#[post("/echo")]
|
||||||
async fn echo(req_body: String) -> impl Responder {
|
async fn echo(req_body: String) -> impl Responder {
|
||||||
@@ -16,6 +12,7 @@ async fn manual_hello() -> impl Responder {
|
|||||||
|
|
||||||
#[actix_web::main]
|
#[actix_web::main]
|
||||||
async fn main() -> std::io::Result<()> {
|
async fn main() -> std::io::Result<()> {
|
||||||
|
dotenv().ok();
|
||||||
HttpServer::new(|| {
|
HttpServer::new(|| {
|
||||||
App::new()
|
App::new()
|
||||||
.service(hello)
|
.service(hello)
|
||||||
|
|||||||
Reference in New Issue
Block a user