From 3b5f1e9cf7e59429163e879c001c12dfb3fcf3ce Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Mon, 12 Apr 2021 23:03:15 +0200 Subject: [PATCH 1/2] [#19] Small changes --- docker/Dockerfile.dev | 3 ++- src/ivago/mod.rs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index a1a1e92..8ebeab3 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -1,6 +1,7 @@ FROM chewingbever/fej-builder:latest -ENV RUST_BACKTRACE=1 +ENV RUST_BACKTRACE 1 +ENV ROCKET_LOG debug ENTRYPOINT ["cargo"] CMD ["run"] diff --git a/src/ivago/mod.rs b/src/ivago/mod.rs index 0e7bebc..627e89b 100644 --- a/src/ivago/mod.rs +++ b/src/ivago/mod.rs @@ -15,9 +15,9 @@ pub fn routes() -> Vec { /// # Arguments /// /// * `search_term` - Search term to use to look for streets -#[get("/search?")] -pub fn route_search_streets(search_term: String) -> Result>, Status> { - Ok(Json(search_streets(search_term.as_str())?)) +#[get("/search?")] +pub fn route_search_streets(q: String) -> Result>, Status> { + Ok(Json(search_streets(q.as_str())?)) } /// Handles returning of pickup times for a specific address. It returns a list From 760e9fa584d472c02f8532f97349ee1652d0cfe5 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Tue, 13 Apr 2021 21:56:52 +0200 Subject: [PATCH 2/2] [#19] Fixed api not working from outside container --- docker/Dockerfile.builder | 2 ++ docker/Dockerfile.dev | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile.builder b/docker/Dockerfile.builder index 62b986e..b968c5b 100644 --- a/docker/Dockerfile.builder +++ b/docker/Dockerfile.builder @@ -4,6 +4,8 @@ FROM alpine:latest AS builder ENV PATH "$PATH:/root/.cargo/bin" # Needed for proper compiling of openssl-dev ENV RUSTFLAGS "-C target-feature=-crt-static" +# Otherwise, the debug build can't be used from the container +ENV ROCKET_ADDRESS "0.0.0.0" WORKDIR /usr/src/app diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index 8ebeab3..9205fd4 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -1,7 +1,6 @@ FROM chewingbever/fej-builder:latest ENV RUST_BACKTRACE 1 -ENV ROCKET_LOG debug ENTRYPOINT ["cargo"] CMD ["run"]