Skip to content

Commit

Permalink
add cors to server
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Sep 25, 2024
1 parent a2f8815 commit 29d9fc9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/web3_account_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ edition = "2021"
name = "web3_account_server"
license = "MIT"
repository = "https://github.com/scx1332/"
version = "0.4.10"
version = "0.4.11"

[dependencies]
actix-cors = { workspace = true }
actix-web = { workspace = true }
actix-web-httpauth = { workspace = true }
env_logger = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions crates/web3_account_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ async fn main() -> std::io::Result<()> {
.app_data(web::Data::new(app_state.clone()))
.wrap(actix_web::middleware::Logger::default())
.wrap(auth)
.wrap(actix_cors::Cors::permissive())
.route("/count", web::get().to(count))
.route("/add", web::post().to(add_to_queue))
.route("/get", web::get().to(get_from_queue))
Expand Down

0 comments on commit 29d9fc9

Please sign in to comment.