Skip to content

Commit

Permalink
adding login route
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcclung committed May 5, 2024
1 parent a301dee commit f2589ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{net::TcpListener, sync::Arc};
use actix_web::{dev::Server, middleware::Logger, web, App, HttpServer};
use sqlx::{Pool, Postgres};

use crate::routes::{confirm, health_check, home, publish_newsletter, subscribe};
use crate::routes::{confirm, health_check, home, login, publish_newsletter, subscribe};

pub struct Application {
port: u16,
Expand Down Expand Up @@ -52,6 +52,7 @@ impl Application {
.route("/subscriptions", web::post().to(subscribe))
.route("/confirm", web::get().to(confirm))
.route("/newsletter", web::post().to(publish_newsletter))
.route("/login", web::get().to(login))
.route("/", web::get().to(home))
.app_data(pool)
.app_data(email_service)
Expand Down
5 changes: 5 additions & 0 deletions src/routes/login.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use actix_web::HttpResponse;

pub async fn login() -> HttpResponse {
HttpResponse::Ok().finish()
}
2 changes: 2 additions & 0 deletions src/routes/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
mod confirm;
mod health_check;
mod home;
mod login;
mod newsletter;
mod subscriptions;

pub use confirm::*;
pub use health_check::*;
pub use home::*;
pub use login::*;
pub use newsletter::*;
pub use subscriptions::*;

0 comments on commit f2589ac

Please sign in to comment.