mirror of
https://github.com/fafhrd91/actix-web
synced 2025-07-02 17:24:39 +02:00
rename Application
This commit is contained in:
@ -5,9 +5,7 @@ extern crate env_logger;
|
||||
extern crate tera;
|
||||
|
||||
use actix_web::{
|
||||
http, error, middleware, server,
|
||||
Application, HttpRequest, HttpResponse, Error,
|
||||
};
|
||||
http, error, middleware, server, App, HttpRequest, HttpResponse, Error};
|
||||
|
||||
|
||||
struct State {
|
||||
@ -38,7 +36,7 @@ fn main() {
|
||||
let _ = server::new(|| {
|
||||
let tera = compile_templates!(concat!(env!("CARGO_MANIFEST_DIR"), "/templates/**/*"));
|
||||
|
||||
Application::with_state(State{template: tera})
|
||||
App::with_state(State{template: tera})
|
||||
// enable logger
|
||||
.middleware(middleware::Logger::default())
|
||||
.resource("/", |r| r.method(http::Method::GET).f(index))})
|
||||
|
Reference in New Issue
Block a user