Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config/dotenvs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ fn overlay(conf: &mut ProjectConfig, envs: impl Iterator<Item = (String, String)
"LEPTOS_SITE_PKG_DIR" => conf.site_pkg_dir = Utf8PathBuf::from(val),
"LEPTOS_STYLE_FILE" => conf.style_file = Some(Utf8PathBuf::from(val)),
"LEPTOS_ASSETS_DIR" => conf.assets_dir = Some(Utf8PathBuf::from(val)),
"LEPTOS_SITE_BASE" => conf.site_base = Utf8PathBuf::from(val),
"LEPTOS_SITE_ADDR" => conf.site_addr = val.parse()?,
"LEPTOS_RELOAD_PORT" => conf.reload_port = val.parse()?,
"LEPTOS_END2END_CMD" => conf.end2end_cmd = Some(val),
Expand Down
3 changes: 3 additions & 0 deletions src/config/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ impl Project {
("LEPTOS_OUTPUT_NAME", self.lib.output_name.to_string()),
("LEPTOS_SITE_ROOT", self.site.root_dir.to_string()),
("LEPTOS_SITE_PKG_DIR", self.site.pkg_dir.to_string()),
("LEPTOS_SITE_BASE", self.site.base.to_string()),
("LEPTOS_SITE_ADDR", self.site.addr.to_string()),
("LEPTOS_RELOAD_PORT", self.site.reload.port().to_string()),
("LEPTOS_LIB_DIR", self.lib.rel_dir.to_string()),
Expand Down Expand Up @@ -238,6 +239,8 @@ impl Project {
pub struct ProjectConfig {
#[serde(default)]
pub output_name: String,
#[serde(default)]
pub site_base: Utf8PathBuf,
#[serde(default = "default_site_addr")]
pub site_addr: SocketAddr,
#[serde(default = "default_site_root")]
Expand Down
3 changes: 3 additions & 0 deletions src/service/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ impl std::fmt::Debug for SiteFile {
}

pub struct Site {
pub base: Utf8PathBuf,
pub addr: SocketAddr,
pub reload: SocketAddr,
pub root_dir: Utf8PathBuf,
Expand All @@ -83,6 +84,7 @@ pub struct Site {
impl fmt::Debug for Site {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Site")
.field("base", &self.base)
.field("addr", &self.addr)
.field("reload", &self.reload)
.field("root_dir", &self.root_dir)
Expand All @@ -98,6 +100,7 @@ impl Site {
let mut reload = config.site_addr;
reload.set_port(config.reload_port);
Self {
base: config.site_base.clone(),
addr: config.site_addr,
reload,
root_dir: config.site_root.clone(),
Expand Down