From 1b3f2da29b6778fae92b35ab4f282b1b7238a4be Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Tue, 24 Dec 2019 01:16:57 +0100 Subject: [PATCH] docs: new error page options --- README.md | 16 ++++++++++------ src/config.rs | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 62bd8fe..292d65d 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ Server is configured either via environment variables: - **SERVER_PORT**: Host port. Default `80`. - **SERVER_ROOT**: Root directory path of static files. Default `./public`. - **SERVER_ASSETS**: Assets directory path for add cache headers functionality. Default `./assets` but relative to the root. +- **SERVER_ERROR_PAGE_404**: HTML file path for 404 errors. Default `./public/404.html`. +- **SERVER_ERROR_PAGE_50X**: HTML file path for 50x errors. Default `./public/50x.html`. Or command line arguments listed with `cargo run -- -h`. @@ -45,12 +47,14 @@ FLAGS: -V, --version Prints version information OPTIONS: - --assets Assets directory path for add cache headers functionality [env: SERVER_ASSETS=] [default: - ./assets] - --host Host address (E.g 127.0.0.1) [env: SERVER_HOST=] [default: [::]] - --name Name for server [env: SERVER_NAME=] [default: my-static-server] - --port Host port [env: SERVER_PORT=] [default: 80] - --root Root directory path of static files [env: SERVER_ROOT=] + --assets Assets directory path for add cache headers functionality [env: SERVER_ASSETS=] + [default: ./assets] + --host Host address (E.g 127.0.0.1) [env: SERVER_HOST=] [default: [::]] + --name Name for server [env: SERVER_NAME=] [default: my-static-server] + --page404 HTML file path for 404 errors [env: SERVER_ERROR_PAGE_404=] [default: ./public/404.html] + --page50x HTML file path for 50x errors [env: SERVER_ERROR_PAGE_50X=] [default: ./public/50x.html] + --port Host port [env: SERVER_PORT=] [default: 80] + --root Root directory path of static files [env: SERVER_ROOT=] [default: ./public] ``` ## Docker stack diff --git a/src/config.rs b/src/config.rs index 4767a1a..a3ff87f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -22,13 +22,13 @@ pub struct Options { default_value = "./public/50x.html", env = "SERVER_ERROR_PAGE_50X" )] - /// HTML file content for 50x errors + /// HTML file path for 50x errors pub page50x: String, #[structopt( long, default_value = "./public/404.html", env = "SERVER_ERROR_PAGE_404" )] - /// HTML file content for 404 errors + /// HTML file path for 404 errors pub page404: String, } -- libgit2 1.7.2