perseus/server/options.rs
1/// The options for setting up all server integrations. This should be literally
2/// constructed, as nothing is optional. If integrations need further
3/// properties, they should expose their own options in addition to these.
4#[derive(Debug, Clone)]
5pub struct ServerOptions {
6 /// The location on the filesystem of your JavaScript bundle.
7 pub js_bundle: String,
8 /// The location on the filesystem of your Wasm bundle.
9 pub wasm_bundle: String,
10 /// The location on the filesystem of your JS bundle converted from your
11 /// Wasm bundle. This isn't required, and if you haven't generated this, you
12 /// should provide a fake path.
13 pub wasm_js_bundle: String,
14 /// The location of the JS interop snippets to be served as static files.
15 pub snippets: String,
16}
17#[cfg(feature = "dflt-engine")]
18impl Default for ServerOptions {
19 fn default() -> Self {
20 Self {
21 js_bundle: "dist/pkg/perseus_engine.js".to_string(),
22 // Our crate has the same name, so this will be predictable
23 wasm_bundle: "dist/pkg/perseus_engine_bg.wasm".to_string(),
24 // This probably won't exist, but on the off chance that the user needs to support older
25 // browsers, we'll provide it anyway
26 wasm_js_bundle: "dist/pkg/perseus_engine_bg.wasm.js".to_string(),
27 snippets: "dist/pkg/snippets".to_string(),
28 }
29 }
30}