load static assets module
This commit is contained in:
parent
dbffef5e30
commit
f5d9094149
2 changed files with 7 additions and 7 deletions
12
src/main.rs
12
src/main.rs
|
@ -31,7 +31,7 @@ mod errors;
|
||||||
mod middleware;
|
mod middleware;
|
||||||
//mod pages;
|
//mod pages;
|
||||||
mod settings;
|
mod settings;
|
||||||
//mod static_assets;
|
mod static_assets;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
@ -41,13 +41,13 @@ pub use api::v1::ROUTES as V1_API_ROUTES;
|
||||||
pub use middleware::auth::CheckLogin;
|
pub use middleware::auth::CheckLogin;
|
||||||
//pub use pages::routes::ROUTES as PAGES;
|
//pub use pages::routes::ROUTES as PAGES;
|
||||||
pub use settings::Settings;
|
pub use settings::Settings;
|
||||||
//pub use static_assets::static_files::assets;
|
pub use static_assets::static_files::assets;
|
||||||
//
|
|
||||||
//use static_assets::FileMap;
|
use static_assets::FileMap;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref SETTINGS: Settings = Settings::new().unwrap();
|
pub static ref SETTINGS: Settings = Settings::new().unwrap();
|
||||||
// pub static ref FILES: FileMap = FileMap::new();
|
pub static ref FILES: FileMap = FileMap::new();
|
||||||
//
|
//
|
||||||
// pub static ref CSS: &'static str =
|
// pub static ref CSS: &'static str =
|
||||||
// FILES.get("./static/cache/bundle/css/main.css").unwrap();
|
// FILES.get("./static/cache/bundle/css/main.css").unwrap();
|
||||||
|
@ -153,5 +153,5 @@ pub fn get_identity_service() -> IdentityService<CookieIdentityPolicy> {
|
||||||
pub fn services(cfg: &mut actix_web::web::ServiceConfig) {
|
pub fn services(cfg: &mut actix_web::web::ServiceConfig) {
|
||||||
//pages::services(cfg);
|
//pages::services(cfg);
|
||||||
api::v1::services(cfg);
|
api::v1::services(cfg);
|
||||||
// static_assets::services(cfg);
|
static_assets::services(cfg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ mod tests {
|
||||||
async fn static_assets_work() {
|
async fn static_assets_work() {
|
||||||
let app = get_app!().await;
|
let app = get_app!().await;
|
||||||
|
|
||||||
for file in [assets::LOGO.path, *crate::CSS].iter() {
|
for file in [assets::LOGO.path].iter() {
|
||||||
let resp = test::call_service(
|
let resp = test::call_service(
|
||||||
&app,
|
&app,
|
||||||
test::TestRequest::get().uri(file).to_request(),
|
test::TestRequest::get().uri(file).to_request(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue