add static route for main.css
Some checks failed
Build and publish the docker image / build (push) Failing after 10s
Some checks failed
Build and publish the docker image / build (push) Failing after 10s
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
@ -20,6 +20,7 @@ use actix_web::{
|
||||
error::InternalError, http::StatusCode, middleware as actix_middleware, web::JsonConfig, App,
|
||||
HttpServer,
|
||||
};
|
||||
use actix_files as fs;
|
||||
use lazy_static::lazy_static;
|
||||
use log::info;
|
||||
|
||||
@ -66,6 +67,7 @@ async fn main() -> std::io::Result<()> {
|
||||
|
||||
HttpServer::new(move || {
|
||||
App::new()
|
||||
.service(fs::Files::new("/static", "./static"))
|
||||
.wrap(actix_middleware::Logger::default())
|
||||
.wrap(actix_middleware::Compress::default())
|
||||
.app_data(get_json_err())
|
||||
|
@ -40,16 +40,10 @@ impl Settings {
|
||||
let mut s = Config::builder();
|
||||
|
||||
// setting default values
|
||||
const CURRENT_DIR: &str = "./config.toml";
|
||||
const ETC: &str = "/etc/libmedium/config.toml";
|
||||
|
||||
if let Ok(path) = env::var("LIBMEDIUM") {
|
||||
s = s.add_source(File::with_name(&path));
|
||||
} else if Path::new(CURRENT_DIR).exists() {
|
||||
// merging default config from file
|
||||
s = s.add_source(File::with_name(CURRENT_DIR));
|
||||
} else if Path::new(ETC).exists() {
|
||||
s = s.add_source(File::with_name(ETC));
|
||||
} else if Path::new("./config.toml").exists() {
|
||||
s = s.add_source(File::with_name("./config.toml");
|
||||
} else {
|
||||
log::warn!("configuration file not found");
|
||||
}
|
||||
|
Reference in New Issue
Block a user