1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00

refactor: use graduated Html responder

This commit is contained in:
Rob Ede
2024-07-07 00:23:03 +01:00
parent 10aff3cdb1
commit a67c7803e6
13 changed files with 27 additions and 40 deletions

View File

@ -2,15 +2,10 @@ use std::{fs, io};
use actix_multipart::form::{tempfile::TempFile, text::Text, MultipartForm};
use actix_web::{
body::SizedStream,
delete, error, get,
http::Method,
middleware::Logger,
post, route,
web::{self},
App, Error, HttpResponse, HttpServer, Responder,
body::SizedStream, delete, error, get, http::Method, middleware::Logger, post, route, web, App,
Error, HttpResponse, HttpServer, Responder,
};
use actix_web_lab::{extract::Path, respond::Html};
use actix_web_lab::extract::Path;
use aws_config::{meta::region::RegionProviderChain, BehaviorVersion};
use dotenvy::dotenv;
use futures_util::{stream, StreamExt as _};
@ -93,7 +88,7 @@ async fn delete_from_s3(
#[get("/")]
async fn index() -> impl Responder {
Html(include_str!("./index.html").to_owned())
web::Html::new(include_str!("./index.html").to_owned())
}
#[actix_web::main]