aboutsummaryrefslogtreecommitdiff
path: root/backend/src/bin
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-12-27 07:02:01 +0000
committerAkshay <[email protected]>2020-12-27 07:02:01 +0000
commitcf314e2d96ce3f5e7cebaca6f33fa8ba373ccb2b (patch)
tree761182b57b92e6ca58cd27513fd5e803542c6734 /backend/src/bin
parent192a5c36c46b50167461c3cf1d7afa069e816e01 (diff)
add userprofile endpoint, fix cors (again?)
Diffstat (limited to 'backend/src/bin')
-rw-r--r--backend/src/bin/server.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/backend/src/bin/server.rs b/backend/src/bin/server.rs
index 310914e..135dccc 100644
--- a/backend/src/bin/server.rs
+++ b/backend/src/bin/server.rs
@@ -34,6 +34,7 @@ async fn main() -> std::io::Result<()> {
34 Cors::default() 34 Cors::default()
35 .allowed_origin("http://127.0.0.1:8000") 35 .allowed_origin("http://127.0.0.1:8000")
36 .allowed_origin("http://localhost:8000") 36 .allowed_origin("http://localhost:8000")
37 .allowed_origin("https://poly.googleusercontent.com")
37 .allow_any_method() 38 .allow_any_method()
38 .allow_any_header(), 39 .allow_any_header(),
39 ) 40 )
@@ -46,6 +47,7 @@ async fn main() -> std::io::Result<()> {
46 .data(pool.clone()) 47 .data(pool.clone())
47 .service( 48 .service(
48 web::scope("/user") 49 web::scope("/user")
50 .route("/profile", web::get().to(users::user_profile))
49 .route("/existing", web::post().to(users::name_exists)) 51 .route("/existing", web::post().to(users::name_exists))
50 .route("/login", web::post().to(users::login)) 52 .route("/login", web::post().to(users::login))
51 .route("/logout", web::post().to(users::logout)) 53 .route("/logout", web::post().to(users::logout))