#[cfg(test)] mod tests; mod controller; use rocket_contrib::json::Json; use chrono::NaiveDate; pub fn routes() -> Vec { routes![ route_search_streets, ] } // URL: https://www.ivago.be/nl/particulier/autocomplete/garbage/streets?q=Lange // TODO make this async // TODO change this so it can return errors instead of empty json #[get("/search?")] pub fn search_streets_json(street: String) -> Json> { match controller::search_streets(&street) { Ok(streets) => Json(streets), Err(err) => Json(Vec::new()), } } #[get("/?&&&")] pub fn route_get_pickup_times( street: controller::Street, number: u64, start_date: NaiveDate, end_date: NaiveDate ) -> Json> { }