Skip to content

Commit

Permalink
Fix: Fix backend_host
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Oct 2, 2023
1 parent 587ffd7 commit b8a852f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/sub-image-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
if: github.ref_name == 'main'
working-directory: .
run: |
apt-get update
apt-get install -y libssl-dev pkg-config
cargo build --release --target x86_64-unknown-linux-gnu
cargo build --release --target aarch64-unknown-linux-gnu
Expand Down
3 changes: 2 additions & 1 deletion sub-image/src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ pub async fn root_get() -> Json<RootResponse> {
pub async fn convert_post(
body: Json<crate::models::ConvertRequest>,
) -> Result<Json<ConvertResponse>> {
let backend_host = std::env::var("BACKEND_HOST").unwrap();
let backend_host =
std::env::var("BACKEND_HOST").unwrap_or_else(|_| "http://localhost:3000".to_string());
info!("Convert: {:?}", body);
let base_image = reqwest::get(&if body.url.starts_with('/') {
format!("{}{}", backend_host, body.url)
Expand Down

0 comments on commit b8a852f

Please sign in to comment.