Make steam-callback-url configurable
This commit is contained in:
@@ -5,6 +5,7 @@ A self-hosted demo analysis tool
|
|||||||
### Environment Variables
|
### Environment Variables
|
||||||
- `DATABASE_URL`
|
- `DATABASE_URL`
|
||||||
- `STEAM_API_KEY`
|
- `STEAM_API_KEY`
|
||||||
|
- `BASE_URL`
|
||||||
|
|
||||||
### Needed external Software
|
### Needed external Software
|
||||||
- `postgresql`
|
- `postgresql`
|
||||||
|
|||||||
@@ -64,13 +64,15 @@ pub async fn run_api(
|
|||||||
let serve_dir = option_env!("FRONTEND_DIST_DIR").unwrap_or("../frontend/dist/");
|
let serve_dir = option_env!("FRONTEND_DIST_DIR").unwrap_or("../frontend/dist/");
|
||||||
tracing::debug!("Serving static files from {:?}", serve_dir);
|
tracing::debug!("Serving static files from {:?}", serve_dir);
|
||||||
|
|
||||||
|
let steam_callback_base_url = std::env::var("BASE_URL").unwrap_or("http://localhost:3000".to_owned());
|
||||||
|
tracing::debug!("Base-URL: {:?}", steam_callback_base_url);
|
||||||
|
|
||||||
let router = axum::Router::new()
|
let router = axum::Router::new()
|
||||||
.nest(
|
.nest(
|
||||||
"/api/",
|
"/api/",
|
||||||
crate::api::router(crate::api::RouterConfig {
|
crate::api::router(crate::api::RouterConfig {
|
||||||
steam_api_key: steam_api_key.into(),
|
steam_api_key: steam_api_key.into(),
|
||||||
steam_callback_base_url: "http://localhost:3000".into(),
|
steam_callback_base_url,
|
||||||
// steam_callback_base_url: "http://192.168.0.156:3000".into(),
|
|
||||||
steam_callback_path: "/api/steam/callback".into(),
|
steam_callback_path: "/api/steam/callback".into(),
|
||||||
upload_dir: upload_folder.clone(),
|
upload_dir: upload_folder.clone(),
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user