Skip to content

Commit

Permalink
chore: update backend config
Browse files Browse the repository at this point in the history
  • Loading branch information
zerj9 committed Nov 12, 2024
1 parent 818aba2 commit ade1437
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gridwalk-backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::core::GeospatialConfig;
use crate::data::Dynamodb;

use anyhow::Result;
use std::env;
use tracing::info;

#[tokio::main]
Expand All @@ -18,7 +19,8 @@ async fn main() -> Result<()> {
tracing_subscriber::fmt::init();

// Create DynamoDB client
let app_db = Dynamodb::new(true, "gridwalk").await.unwrap();
let table_name = env::var("DYNAMODB_TABLE").unwrap_or_else(|_| "gridwalk".to_string());
let app_db = Dynamodb::new(false, &table_name).await.unwrap();

// Create GeospatialConfig
let geospatial_config = GeospatialConfig::new();
Expand All @@ -31,7 +33,7 @@ async fn main() -> Result<()> {

// Run app
let app = server::create_app(app_state);
let listener = tokio::net::TcpListener::bind("127.0.0.1:3001").await?;
let listener = tokio::net::TcpListener::bind("0.0.0.0:3001").await?;
info!("Server listening on {}", listener.local_addr()?);
axum::serve(listener, app).await?;

Expand Down

0 comments on commit ade1437

Please sign in to comment.