Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
HCHogan committed Aug 4, 2024
1 parent 8e6f26a commit 4762a24
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion api/src/handler/message_handler.rs

This file was deleted.

3 changes: 0 additions & 3 deletions api/src/handler/mod.rs

This file was deleted.

5 changes: 3 additions & 2 deletions api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub mod config;
pub mod db;
pub mod error;
pub mod handler;
pub mod services;
pub mod middleware;
pub mod models;
pub mod router;
Expand Down Expand Up @@ -34,7 +34,7 @@ pub async fn main() -> Result<()> {

let router = Router::new()
.push(Router::with_path("api").push(router::make_router(&config).await))
.push(crate::router::socket_chat::make_router());
.push(crate::services::socket_chat::make_router());

// TODO: http3
let server = Server::new(acceptor);
Expand All @@ -50,6 +50,7 @@ pub async fn main() -> Result<()> {
Ok(())
}


// Break this test into smaller routes.
#[cfg(test)]
mod tests {
Expand Down
2 changes: 1 addition & 1 deletion api/src/models/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub mod message;
pub mod user;
pub mod server;
pub mod thread;
Empty file removed api/src/models/server.rs
Empty file.
File renamed without changes.
5 changes: 2 additions & 3 deletions api/src/router/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
pub mod socket_chat;

use crate::config::Config;
use crate::db;
use crate::middleware::basic_auth::Validator;
use crate::services;
use crate::state::AppState;
use color_eyre::Result;
use salvo::affix;
Expand Down Expand Up @@ -31,7 +30,7 @@ pub async fn make_router(config: &Config) -> Router {
let router = Router::new()
.hoop(affix::inject(state))
.push(Router::with_path("hello").get(hello))
.push(socket_chat::make_router())
.push(services::socket_chat::make_router())
.push(
Router::with_hoop(auth_handler)
.path("hello_admin")
Expand Down
2 changes: 2 additions & 0 deletions api/src/services/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod socket_chat;
pub mod user;
File renamed without changes.
File renamed without changes.

0 comments on commit 4762a24

Please sign in to comment.