【发布时间】:2022-12-21 02:27:21
【问题描述】:
我有以下主要功能(因为我使用 actix 来提供公共 API,所以有 CORS):
use actix_cors::Cors;
use anyhow::Result;
use actix_web::{App, HttpServer};
#[actix_web::main]
async fn main() -> Result<()> {
HttpServer::new(|| App::new().wrap(Cors::permissive().send_wildcard()))
.bind(("localhost", 8080))?
.run()
.await
.map_err(anyhow::Error::from)
}
它使用 anyhow、actix_web 和 actix_cors。
每当我运行它时,都会立即发生错误。我怎样才能解决这个问题?
【问题讨论】: