Added docs; started README; started ivago
This commit is contained in:
parent
1ff5682fd9
commit
ba5d149a60
8 changed files with 44 additions and 27 deletions
9
src/ivago/controller.rs
Normal file
9
src/ivago/controller.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/// Searches the Ivago API for streets in the given city
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `street` -name of the street
|
||||
/// * `city` - city the street is in
|
||||
pub fn search_streets(street: String, city: String) -> Vec<String> {
|
||||
Vec::new()
|
||||
}
|
||||
|
|
@ -1,22 +1,23 @@
|
|||
#[cfg(test)] mod tests;
|
||||
|
||||
// use rocket_contrib::json::Json;
|
||||
// use rocket::Route;
|
||||
use http::{Request, Response};
|
||||
|
||||
mod controller;
|
||||
use controller as ctrl;
|
||||
|
||||
pub fn routes() -> Vec<rocket::Route> {
|
||||
routes![search_streets]
|
||||
routes![
|
||||
search_streets,
|
||||
]
|
||||
}
|
||||
|
||||
// URL: https://www.ivago.be/nl/particulier/autocomplete/garbage/streets?q=Lange
|
||||
#[get("/search?<street>")]
|
||||
pub fn search_streets(street: String) -> String {
|
||||
// Build the request
|
||||
let mut request = Request::get(
|
||||
"https://www.ivago.be/nl/particulier/autocomplete/garbage/streets")
|
||||
.body(())
|
||||
.unwrap();
|
||||
// // Build the request
|
||||
// let mut request = Request::get(
|
||||
// "https://www.ivago.be/nl/particulier/autocomplete/garbage/streets")
|
||||
// .body(())
|
||||
// .unwrap();
|
||||
|
||||
let response = send(request.body(()).unwrap());
|
||||
// let response = send(request.body(()).unwrap());
|
||||
"".to_string()
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue