Skip to content

Commit

Permalink
Move variable inside serve function
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Wahl <[email protected]>

As per #212 (comment)
  • Loading branch information
shaedrich authored Jun 30, 2024
1 parent 6f72699 commit 89f40de
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ use axum::http::HeaderValue;
use std::net::SocketAddr;
use tower_http::cors::CorsLayer;

let layer: CorsLayer = CorsLayer::new().allow_origin(
"https://tutorial.ponylang.io"
.parse::<HeaderValue>()
.unwrap(),
);

/// serve the api
pub async fn serve(addr: SocketAddr, github_client: GithubClient) -> Result<()> {
let layer: CorsLayer = CorsLayer::new().allow_origin(
"https://tutorial.ponylang.io"
.parse::<HeaderValue>()
.unwrap(),
);

let static_routes = Router::new()
.route(
"/web.css",
Expand Down

0 comments on commit 89f40de

Please sign in to comment.