Skip to content

Commit 220bd54

Browse files
bloussoumultun
authored andcommitted
editoast: Add ROOT_PATH support
1 parent 87d57a4 commit 220bd54

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

editoast/src/client/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ pub struct RunserverArgs {
6363
pub sentry_dsn: Option<String>,
6464
#[arg(long, env = "SENTRY_ENV")]
6565
pub sentry_env: Option<String>,
66+
#[derivative(Default(value = r#""".into()"#))]
67+
#[clap(long, env = "ROOT_PATH", default_value_t = String::new())]
68+
pub root_path: String,
6669
}
6770

6871
#[derive(Args, Debug)]

editoast/src/main.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use crate::views::infra::InfraForm;
2424
use crate::views::OpenApiRoot;
2525
use actix_cors::Cors;
2626
use actix_web::middleware::{Condition, Logger, NormalizePath};
27-
use actix_web::web::{block, Data, JsonConfig, PayloadConfig};
27+
use actix_web::web::{block, scope, Data, JsonConfig, PayloadConfig};
2828
use actix_web::{App, HttpServer};
2929
use chashmap::CHashMap;
3030
use clap::Parser;
@@ -172,7 +172,11 @@ async fn runserver(
172172
.app_data(Data::new(args.map_layers_config.clone()))
173173
.app_data(Data::new(SearchConfig::parse()))
174174
.app_data(Data::new(core_client))
175-
.service((views::routes(), views::study_routes()))
175+
.service(
176+
scope(&args.root_path)
177+
.service(views::routes())
178+
.service(views::study_routes()),
179+
)
176180
});
177181

178182
// Run server

0 commit comments

Comments
 (0)