mirror of
https://git.alemi.dev/guestbook.rs.git
synced 2024-12-19 02:54:52 +01:00
fix: imports only if web feat is enabled
This commit is contained in:
parent
632a4a179c
commit
06bfb9157b
1 changed files with 4 additions and 3 deletions
|
@ -1,9 +1,8 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use axum::{Json, Form, Router, routing::{put, post, get}, extract::{State, Query}, response::{Redirect, Html}};
|
use axum::{Json, Form, Router, routing::{put, post, get}, extract::{State, Query}, response::{Redirect, Html}};
|
||||||
use axum_extra::response::{Css, JavaScript};
|
|
||||||
|
|
||||||
use crate::{notifications::NotificationProcessor, model::{Page, PageOptions, PageInsertion, PageView}, storage::StorageProvider, web::IndexTemplate, config::ConfigRouting};
|
use crate::{notifications::NotificationProcessor, model::{Page, PageOptions, PageInsertion, PageView}, storage::StorageProvider, config::ConfigRouting};
|
||||||
|
|
||||||
pub fn create_router_with_app_routes(state: Context) -> Router {
|
pub fn create_router_with_app_routes(state: Context) -> Router {
|
||||||
let mut router = Router::new()
|
let mut router = Router::new()
|
||||||
|
@ -14,7 +13,9 @@ pub fn create_router_with_app_routes(state: Context) -> Router {
|
||||||
#[cfg(feature = "web")]
|
#[cfg(feature = "web")]
|
||||||
{
|
{
|
||||||
use sailfish::TemplateOnce;
|
use sailfish::TemplateOnce;
|
||||||
let template = IndexTemplate::from(&state.template)
|
use axum_extra::response::{Css, JavaScript};
|
||||||
|
|
||||||
|
let template = crate::web::IndexTemplate::from(&state.template)
|
||||||
.render_once()
|
.render_once()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
router = router
|
router = router
|
||||||
|
|
Loading…
Reference in a new issue