feat: deploy to vercel & use ALB on ecs

This commit is contained in:
2026-01-21 23:03:22 -08:00
parent cfd2e0d2c2
commit d9622ea451
11 changed files with 89 additions and 62 deletions

View File

@@ -37,7 +37,7 @@ pub async fn proxy_file(
.error_for_status_ref()
.map_err(|_| crate::error::Error::NotFound)?;
let bytes = response.bytes().await?;
let stream = response.bytes_stream();
let mime = mime_guess::from_path(&path.file)
.first_or_octet_stream()
.to_string();
@@ -45,5 +45,5 @@ pub async fn proxy_file(
Ok(HttpResponse::Ok()
.content_type(mime)
.insert_header(("Cache-Control", "public, max-age=3600"))
.body(bytes))
.streaming(stream))
}

View File

@@ -98,7 +98,7 @@ async fn run() -> std::io::Result<()> {
),
)
})
.bind(("0.0.0.0", 8080))?
.bind((env::var("ADDRESS").unwrap_or("0.0.0.0".to_string()), 8080))?
.run()
.await
}

View File

@@ -169,7 +169,7 @@ impl UserRepository {
.item("gsi1pk", AttributeValue::S("REPOS".into()))
.item("gsi1sk", AttributeValue::S(now.clone()))
.item("imported_at", AttributeValue::S(now))
.item("approved", AttributeValue::Bool(false))
.item("approved", AttributeValue::Bool(true))
.item("owner_id", AttributeValue::S(user_id.into()))
.item("description", AttributeValue::S(repo.description.clone()))
.send()