diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2019-04-08 12:31:26 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2019-04-08 12:31:26 +0200 |
commit | a7c734d39512385177426bcb2131726906ce2fff (patch) | |
tree | 9a42886afebda28ce712ea88f2250dd8b5e79134 /src/lib.rs | |
parent | 9c8b8a254a5223cd359df150279f78e644b58abb (diff) | |
download | ramaskrik-social-a7c734d39512385177426bcb2131726906ce2fff.tar.gz ramaskrik-social-a7c734d39512385177426bcb2131726906ce2fff.tar.bz2 ramaskrik-social-a7c734d39512385177426bcb2131726906ce2fff.zip |
Add endpoint to fetch screenings from the database.
Not entirely happy about the way this turned out for now. A more ergonomic
return type from the models::screenings::get_all() function will be
investigated.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -23,7 +23,7 @@ mod controllers; pub mod db; pub mod models; pub mod schema; -use crate::controllers::{film, room}; +use crate::controllers::{film, room, screening}; use rocket::routes; use std::collections::HashMap; @@ -44,5 +44,6 @@ pub fn build_rocket(db_url: &str) -> Result<rocket::Rocket, Box<dyn Error>> { .attach(db::Connection::fairing()) .mount("/", rocket_contrib::serve::StaticFiles::from("./public")) .mount("/rooms", routes![room::get_rooms]) - .mount("/films", routes![film::get_films])) + .mount("/films", routes![film::get_films]) + .mount("/screenings", routes![screening::get_screenings])) } |