-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Failed to fetch in Swagger #28
Comments
plus, response is fine when I use curl in cmd |
I found a way to sovle this problem OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::ConnectionHandler>, serverConnectionHandler)([] {
OATPP_COMPONENT(std::shared_ptr<oatpp::web::server::HttpRouter>, router); // get Router component
OATPP_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper); // get ObjectMapper component
auto connectionHandler = oatpp::web::server::HttpConnectionHandler::createShared(router);
connectionHandler->setErrorHandler(std::make_shared<ErrorHandler>(objectMapper));
/* Add CORS-enabling interceptors */
connectionHandler->addRequestInterceptor(std::make_shared<oatpp::web::server::interceptor::AllowOptionsGlobal>());
connectionHandler->addResponseInterceptor(std::make_shared<oatpp::web::server::interceptor::AllowCorsGlobal>());
return connectionHandler;
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran this project successfully but met TypeError when I test api,
I am using a macbook air m1, no code is modified, so I was confused
The text was updated successfully, but these errors were encountered: