deployment-tweaks (#17)
Reviewed-on: #17 Co-authored-by: Drew Galbraith <drew@tiramisu.one> Co-committed-by: Drew Galbraith <drew@tiramisu.one>
This commit is contained in:
parent
25eb4af14d
commit
ef609f748d
3 changed files with 7 additions and 11 deletions
|
|
@ -14,16 +14,12 @@ async fn main() {
|
|||
let pool = database::create_pool(&binding)
|
||||
.await
|
||||
.expect("Failed to create database pool");
|
||||
let cors = if std::env::var("RUST_ENV").unwrap_or_default() == "production" {
|
||||
|
||||
sqlx::migrate!().run(&pool).await.expect("Failed t");
|
||||
|
||||
let cors = if let Ok(domain) = std::env::var("CAPTAINS_LOG_URL") {
|
||||
CorsLayer::new()
|
||||
.allow_origin([
|
||||
"https://tiramisu.one"
|
||||
.parse::<axum::http::HeaderValue>()
|
||||
.unwrap(),
|
||||
"https://*.tiramisu.one"
|
||||
.parse::<axum::http::HeaderValue>()
|
||||
.unwrap(),
|
||||
])
|
||||
.allow_origin([domain.parse::<axum::http::HeaderValue>().unwrap()])
|
||||
.allow_methods(Any)
|
||||
.allow_headers(Any)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue