Impl a router and handlers #12

Closed
opened 2022-10-04 14:27:09 +02:00 by rmanach · 1 comment
rmanach commented 2022-10-04 14:27:09 +02:00 (Migrated from gitea.thegux.fr)

The response logic is in the HTTPResponse::from() associated function but it's ugly... To follow the web server design pattern, implement a Router calling the right Controller (handle the response logic).

The response logic is in the `HTTPResponse::from()` associated function but it's ugly... To follow the web server design pattern, implement a `Router` calling the right `Controller` (handle the response logic).
rmanach commented 2022-10-06 09:56:47 +02:00 (Migrated from gitea.thegux.fr)

Router must route the request to the right Handler:

  • rename handlers module to http with request.rs and response.rs
  • Router may have is own module (interface between the http and handlers modules)
  • create an handlers module implementing the logic
`Router` must route the request to the right `Handler`: * rename **handlers** module to **http** with `request.rs` and `response.rs` * `Router` may have is own module (interface between the http and handlers modules) * create an **handlers** module implementing the logic
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rmanach/simple-auth#12
No description provided.