mirror of
https://github.com/actix/examples
synced 2025-06-28 18:00:37 +02:00
Update to master (#90)
This commit is contained in:
@ -6,9 +6,9 @@ workspace = ".."
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-web = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
|
||||
actix-files = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
|
||||
actix-session = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
|
||||
actix-web = { git="https://github.com/actix/actix-web.git" }
|
||||
actix-files = { git="https://github.com/actix/actix-web.git" }
|
||||
actix-session = { git="https://github.com/actix/actix-web.git" }
|
||||
dotenv = "0.13.0"
|
||||
env_logger = "0.5.10"
|
||||
futures = "0.1.22"
|
||||
|
@ -1,6 +1,6 @@
|
||||
use actix_files::NamedFile;
|
||||
use actix_session::Session;
|
||||
use actix_web::middleware::ErrorHandlerResponse;
|
||||
use actix_web::middleware::errhandlers::ErrorHandlerResponse;
|
||||
use actix_web::{dev, error, http, web, Error, HttpResponse, Responder, Result};
|
||||
use futures::future::{err, Either, Future, IntoFuture};
|
||||
use tera::{Context, Tera};
|
||||
|
@ -11,7 +11,7 @@ use std::{env, io};
|
||||
|
||||
use actix_files as fs;
|
||||
use actix_session::CookieSession;
|
||||
use actix_web::middleware::{ErrorHandlers, Logger};
|
||||
use actix_web::middleware::{errhandlers::ErrorHandlers, Logger};
|
||||
use actix_web::{http, web, App, HttpServer};
|
||||
use dotenv::dotenv;
|
||||
use tera::Tera;
|
||||
@ -49,11 +49,11 @@ fn main() -> io::Result<()> {
|
||||
.handler(http::StatusCode::NOT_FOUND, api::not_found);
|
||||
|
||||
App::new()
|
||||
.state(templates)
|
||||
.state(pool.clone())
|
||||
.middleware(Logger::default())
|
||||
.middleware(session_store)
|
||||
.middleware(error_handlers)
|
||||
.data(templates)
|
||||
.data(pool.clone())
|
||||
.wrap(Logger::default())
|
||||
.wrap(session_store)
|
||||
.wrap(error_handlers)
|
||||
.service(web::resource("/").route(web::get().to_async(api::index)))
|
||||
.service(web::resource("/todo").route(web::post().to_async(api::create)))
|
||||
.service(
|
||||
|
Reference in New Issue
Block a user