const DEFAULT_COMMAND_SOCKET : &str = "command.socket"; // in save dir
const DEFAULT_TEMPLATE_DIR : &str = "templates";
const DEFAULT_LIBRARY_DIR : &str = "library";
+const DEFAULT_WASM_DIR : &str = "target/packed-wasm";
#[derive(Deserialize,Debug,Clone)]
pub struct ServerConfigSpec {
pub http_port: Option<u16>,
pub rocket_workers: Option<u16>,
pub template_dir: Option<String>,
+ pub wasm_dir: Option<String>,
pub log: Option<toml::Value>,
pub bundled_sources: Option<String>,
pub shapelibs: Option<Vec<shapelib::Config1>>,
pub http_port: Option<u16>,
pub rocket_workers: u16,
pub template_dir: String,
+ pub wasm_dir: String,
pub log: LogSpecification,
pub bundled_sources: String,
pub shapelibs: Vec<shapelib::Config1>,
fn try_from(spec: ServerConfigSpec) -> ServerConfig {
let ServerConfigSpec {
save_directory, command_socket, debug,
- http_port, rocket_workers, template_dir, log, bundled_sources,
- shapelibs,
+ http_port, rocket_workers, template_dir, wasm_dir,
+ log, bundled_sources, shapelibs,
} = spec;
let save_directory = save_directory
format!("{}/*.toml", DEFAULT_LIBRARY_DIR)
)]);
+ let wasm_dir = wasm_dir.unwrap_or_else(|| DEFAULT_WASM_DIR.to_owned());
+
ServerConfig {
save_directory, command_socket, debug,
- http_port, rocket_workers, template_dir, log, bundled_sources,
- shapelibs,
+ http_port, rocket_workers, template_dir, wasm_dir,
+ log, bundled_sources, shapelibs,
}
}
}