Skip to content

Commit

Permalink
Fixing example
Browse files Browse the repository at this point in the history
  • Loading branch information
l1x authored and lazear committed Dec 12, 2023
1 parent c47ebe0 commit 69b9020
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions examples/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use axum::extract::State;
use axum::http::header::{ACCEPT, ACCEPT_ENCODING, AUTHORIZATION, CONTENT_TYPE, ORIGIN};
use axum::response::IntoResponse;
use axum::{
routing::{get, post},
Json, Router,
};
use http::header::{ACCEPT, ACCEPT_ENCODING, AUTHORIZATION, CONTENT_TYPE, ORIGIN};
use http::Request;
use hyper::Request;
use hyper::{Body, StatusCode};
use serde::{Deserialize, Serialize};
use std::sync::{Arc, Mutex};
Expand Down Expand Up @@ -54,13 +54,7 @@ async fn main() {

// Set up CORS
let cors_layer = CorsLayer::new()
.allow_headers(vec![
ACCEPT,
ACCEPT_ENCODING,
AUTHORIZATION,
CONTENT_TYPE,
ORIGIN,
])
.allow_headers([ACCEPT, ACCEPT_ENCODING, AUTHORIZATION, CONTENT_TYPE, ORIGIN])
.allow_methods(tower_http::cors::Any)
.allow_origin(tower_http::cors::Any);

Expand Down

0 comments on commit 69b9020

Please sign in to comment.