-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(faucet): embed static website (#411)
This removes the need to separately bundle this resource, simplifying the deployment process. The server url is now determined using the webpage url instead of being hardcoded to localhost. This means we no longer have to manually edit it to whatever IP it is being served on.
- Loading branch information
1 parent
90e510d
commit ab1bf87
Showing
6 changed files
with
79 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use std::str::FromStr; | ||
|
||
fn main() -> std::io::Result<()> { | ||
// The location of our static faucet website files. | ||
let static_dir = std::path::PathBuf::from_str(std::env!("CARGO_MANIFEST_DIR")) | ||
.unwrap() | ||
.join("src") | ||
.join("static"); | ||
println!("cargo::rerun-if-changed={}", static_dir.to_str().expect("Valid utf-8")); | ||
// This makes the static files available as an embedded resource. | ||
static_files::resource_dir(static_dir).build() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters