Fix app_data

This commit is contained in:
Dessalines 2021-07-05 17:58:28 -04:00
parent 3f013fbce5
commit acbc12aac4

View file

@ -2,7 +2,7 @@
extern crate diesel_migrations; extern crate diesel_migrations;
use actix::prelude::*; use actix::prelude::*;
use actix_web::*; use actix_web::{web::Data, *};
use diesel::{ use diesel::{
r2d2::{ConnectionManager, Pool}, r2d2::{ConnectionManager, Pool},
PgConnection, PgConnection,
@ -88,7 +88,7 @@ async fn main() -> Result<(), LemmyError> {
let rate_limiter = rate_limiter.clone(); let rate_limiter = rate_limiter.clone();
App::new() App::new()
.wrap(middleware::Logger::default()) .wrap(middleware::Logger::default())
.app_data(context) .app_data(Data::new(context))
// The routes // The routes
.configure(|cfg| api_routes::config(cfg, &rate_limiter)) .configure(|cfg| api_routes::config(cfg, &rate_limiter))
.configure(lemmy_apub_receive::routes::config) .configure(lemmy_apub_receive::routes::config)