Skip to content

Commit 636d6e5

Browse files
authored
Merge pull request #34 from SakaDream/make-it-works-with-yew-address-book-frontend
Make it works with yew address book project
2 parents 7a68d53 + 758efd9 commit 636d6e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,16 @@ async fn main() -> io::Result<()> {
5757
HttpServer::new(move || {
5858
App::new()
5959
.wrap(Cors::default() // allowed_origin return access-control-allow-origin: * by default
60-
// .allowed_origin("http://127.0.0.1:8080")
60+
.allowed_origin("http://127.0.0.1:3000")
61+
.allowed_origin("http://localhost:3000")
6162
.send_wildcard()
6263
.allowed_methods(vec!["GET", "POST", "PUT", "DELETE"])
6364
.allowed_headers(vec![http::header::AUTHORIZATION, http::header::ACCEPT])
6465
.allowed_header(http::header::CONTENT_TYPE)
6566
.max_age(3600))
6667
.data(pool.clone())
6768
.wrap(actix_web::middleware::Logger::default())
69+
// If you want to use yew-address-book-frontend, please comment an auth_middleware wrapping code
6870
.wrap(crate::middleware::auth_middleware::Authentication)
6971
.wrap_fn(|req, srv| {
7072
srv.call(req).map(|res| res)

0 commit comments

Comments
 (0)