Skip to content

Commit

Permalink
Merge pull request #44 from kochamaltki/tomek
Browse files Browse the repository at this point in the history
profilowe part1
  • Loading branch information
malinowy5 authored Apr 2, 2024
2 parents 35adf49 + 308b527 commit d81eb6b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/target
Cargo.lock
projekt-db
SECRET
SECRET
/media/backround/*
/media/profile_pictures/*
!/media/backround/default.*
!/media/profile_pictures/default.*
Binary file added media/profile_pictures/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ pub fn routes() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejecti
.and(ban_json())
.and_then(ban_user);

let get_profile_picture = warp::path("api")
.and(warp::path("get"))
.and(warp::path("profile-picture"))
.and(warp::fs::dir("./media/profile_pictures"));

let get_background = warp::path("api")
.and(warp::path("get"))
.and(warp::path("background"))
.and(warp::fs::dir("./media/background"));


get_posts_by_user
.or(post)
Expand All @@ -182,6 +192,8 @@ pub fn routes() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejecti
.or(react)
.or(get_reactions_from_post)
.or(get_profile_by_id)
.or(get_profile_picture)
.or(get_background)
// .or(get_posts_from_search)
// .or(get_users_from_search)
}
Expand Down

0 comments on commit d81eb6b

Please sign in to comment.