Añade las dependencias para soportar Actix-web 4
Pendiente de que Maud libere una nueva versión con las modificaciones aplicadas en https://github.com/lambda-fairy/maud/pull/331 para soportar Actix-web 4.
This commit is contained in:
parent
1102a76e47
commit
ad65ab494c
3 changed files with 26 additions and 41 deletions
|
|
@ -27,23 +27,24 @@ categories = [
|
||||||
doc-comment = "0.3.3"
|
doc-comment = "0.3.3"
|
||||||
downcast-rs = "1.2.0"
|
downcast-rs = "1.2.0"
|
||||||
figlet-rs = "0.1.3"
|
figlet-rs = "0.1.3"
|
||||||
futures = "0.3"
|
futures = "0.3.21"
|
||||||
once_cell = "1.9.0"
|
once_cell = "1.9.0"
|
||||||
url = "2.2.2"
|
url = "2.2.2"
|
||||||
|
|
||||||
config_rs = { package = "config", version = "0.11.0", features = ["toml"] }
|
config_rs = { package = "config", version = "0.11.0", features = ["toml"] }
|
||||||
|
|
||||||
tracing = "0.1"
|
tracing = "0.1.32"
|
||||||
tracing-appender = "0.2"
|
tracing-appender = "0.2.1"
|
||||||
tracing-subscriber = { version = "0.3", features = ["json", "env-filter"] }
|
tracing-subscriber = { version = "0.3.9", features = ["json", "env-filter"] }
|
||||||
tracing-unwrap = { version = "0.9", default-features = false }
|
tracing-unwrap = { version = "0.9.2", default-features = false }
|
||||||
tracing-actix-web = "0.2"
|
tracing-actix-web = "0.5.1"
|
||||||
|
|
||||||
fluent-templates = "0.6.1"
|
fluent-templates = "0.6.1"
|
||||||
unic-langid = "0.9.0"
|
unic-langid = "0.9.0"
|
||||||
|
|
||||||
actix-web = "3.3.3"
|
actix-web = "4.0.1"
|
||||||
actix-web-static-files = "3.0.5"
|
actix-web-static-files = "4.0.0"
|
||||||
|
static-files = "0.2.3"
|
||||||
|
|
||||||
maud = { version = "0.23.0", features = ["actix-web"] }
|
maud = { version = "0.23.0", features = ["actix-web"] }
|
||||||
sycamore = { version = "0.7.1", features = ["ssr"] }
|
sycamore = { version = "0.7.1", features = ["ssr"] }
|
||||||
|
|
@ -51,13 +52,13 @@ sycamore = { version = "0.7.1", features = ["ssr"] }
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
|
||||||
[dependencies.sea-orm]
|
[dependencies.sea-orm]
|
||||||
version = "0.6"
|
version = "0.6.0"
|
||||||
features = ["debug-print", "macros", "runtime-async-std-native-tls"]
|
features = ["debug-print", "macros", "runtime-async-std-native-tls"]
|
||||||
default-features = false
|
default-features = false
|
||||||
optional = true
|
optional = true
|
||||||
|
|
||||||
[dependencies.sea-schema]
|
[dependencies.sea-schema]
|
||||||
version = "0.5"
|
version = "0.6.0"
|
||||||
features = ["debug-print", "migration"]
|
features = ["debug-print", "migration"]
|
||||||
default-features = false
|
default-features = false
|
||||||
optional = true
|
optional = true
|
||||||
|
|
@ -69,7 +70,7 @@ postgres = ["sea-orm", "sea-schema", "sea-orm/sqlx-postgres"]
|
||||||
sqlite = ["sea-orm", "sea-schema", "sea-orm/sqlx-sqlite"]
|
sqlite = ["sea-orm", "sea-schema", "sea-orm/sqlx-sqlite"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
actix-web-static-files = "3.0.5"
|
static-files = "0.2.3"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "pagetop"
|
name = "pagetop"
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,19 @@
|
||||||
use actix_web_static_files::resource_dir;
|
use static_files::resource_dir;
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
resource_dir("./static/theme")
|
build_resource_dir("./static/theme", "theme.rs", "assets");
|
||||||
.with_generated_filename(
|
build_resource_dir("./static/aliner", "aliner.rs", "assets");
|
||||||
Path::new(env::var("OUT_DIR").unwrap().as_str())
|
build_resource_dir("./static/bootsier", "bootsier.rs", "assets");
|
||||||
.join("theme.rs")
|
}
|
||||||
)
|
|
||||||
.with_generated_fn("assets")
|
fn build_resource_dir(dir: &str, with_filename: &str, with_fn: &str) {
|
||||||
.build()
|
let mut resource = resource_dir(dir);
|
||||||
.unwrap();
|
resource.with_generated_filename(
|
||||||
|
Path::new(env::var("OUT_DIR").unwrap().as_str()).join(with_filename)
|
||||||
resource_dir("./static/aliner")
|
);
|
||||||
.with_generated_filename(
|
resource.with_generated_fn(with_fn);
|
||||||
Path::new(env::var("OUT_DIR").unwrap().as_str())
|
resource.build().unwrap();
|
||||||
.join("aliner.rs")
|
|
||||||
)
|
|
||||||
.with_generated_fn("assets")
|
|
||||||
.build()
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
resource_dir("./static/bootsier")
|
|
||||||
.with_generated_filename(
|
|
||||||
Path::new(env::var("OUT_DIR").unwrap().as_str())
|
|
||||||
.join("bootsier.rs")
|
|
||||||
)
|
|
||||||
.with_generated_fn("assets")
|
|
||||||
.build()
|
|
||||||
.unwrap();
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ use crate::core::theme::register_theme;
|
||||||
use crate::core::module::register_module;
|
use crate::core::module::register_module;
|
||||||
|
|
||||||
use std::io::Error;
|
use std::io::Error;
|
||||||
use actix_web::middleware::normalize::{NormalizePath, TrailingSlash};
|
|
||||||
|
|
||||||
pub struct Application {
|
pub struct Application {
|
||||||
server: Server,
|
server: Server,
|
||||||
|
|
@ -77,8 +76,7 @@ impl Application {
|
||||||
// Prepara el servidor web.
|
// Prepara el servidor web.
|
||||||
let server = server::HttpServer::new(move || {
|
let server = server::HttpServer::new(move || {
|
||||||
server::App::new()
|
server::App::new()
|
||||||
.wrap(tracing_actix_web::TracingLogger)
|
.wrap(tracing_actix_web::TracingLogger::default())
|
||||||
.wrap(NormalizePath::new(TrailingSlash::Trim))
|
|
||||||
.configure(&global::themes)
|
.configure(&global::themes)
|
||||||
.configure(&global::modules)
|
.configure(&global::modules)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue