Commit e541a67f authored by Chunchi Che's avatar Chunchi Che

add cors

parent 9926b708
......@@ -28,7 +28,9 @@ async fn main() -> anyhow::Result<()> {
.with(cors);
// TODO: 模块化
let images = warp::path("images").and(warp::fs::dir("./images/"));
let images = warp::path("images")
.and(warp::fs::dir("./images/"))
.with(cors);
warp::serve(deck.or(cards).or(images))
.run(SocketAddr::from_str(SERVE_ADDR)?)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment