From a7c734d39512385177426bcb2131726906ce2fff Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 8 Apr 2019 12:31:26 +0200 Subject: 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. --- src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index a0eabc8..6554e7c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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> { .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])) } -- cgit v1.2.3