mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2024-12-26 23:25:55 -05:00
update missing ui-dir log lines
https://github.com/scottlamb/moonfire-nvr/issues/218#issuecomment-1098671419
This commit is contained in:
parent
9e6ac27cb0
commit
21da924d84
@ -196,7 +196,7 @@ impl Service {
|
|||||||
match FsDir::builder().for_path(&d) {
|
match FsDir::builder().for_path(&d) {
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!(
|
warn!(
|
||||||
"Unable to load --ui-dir={}; will serve no static files: {}",
|
"Unable to load ui dir {}; will serve no static files: {}",
|
||||||
d.display(),
|
d.display(),
|
||||||
e
|
e
|
||||||
);
|
);
|
||||||
|
@ -11,10 +11,9 @@ use super::{internal_server_err, not_found, ResponseResult, Service};
|
|||||||
impl Service {
|
impl Service {
|
||||||
/// Serves a static file if possible.
|
/// Serves a static file if possible.
|
||||||
pub(super) async fn static_file(&self, req: Request<hyper::Body>) -> ResponseResult {
|
pub(super) async fn static_file(&self, req: Request<hyper::Body>) -> ResponseResult {
|
||||||
let dir = self
|
let dir = self.ui_dir.clone().ok_or_else(|| {
|
||||||
.ui_dir
|
not_found("ui dir not configured or missing; no static files available.")
|
||||||
.clone()
|
})?;
|
||||||
.ok_or_else(|| not_found("--ui-dir not configured; no static files available."))?;
|
|
||||||
let static_req = match StaticFileRequest::parse(req.uri().path()) {
|
let static_req = match StaticFileRequest::parse(req.uri().path()) {
|
||||||
None => return Err(not_found("static file not found")),
|
None => return Err(not_found("static file not found")),
|
||||||
Some(r) => r,
|
Some(r) => r,
|
||||||
|
Loading…
Reference in New Issue
Block a user