---
title: "Comment by Shacoca on \"Build an Easy Rest API in python with Swagger UI\" | Hashnode"
description: "Hi, Trying your example, I had CORS problem using the rest api. Found on https://flask-cors.readthedocs.io/en/latest/ : In the simplest case, initialize the Fla"
url: "https://hashnode.com/posts/build-an-easy-rest-api-in-python-with-swagger-ui/61ae038d9dc5a836391baab2/comment/61b1fa9d6a81cf6b31dfc341"
---

[Discussion](https://hashnode.com/posts/build-an-easy-rest-api-in-python-with-swagger-ui/61ae038d9dc5a836391baab2)

Comment [Build an Easy Rest API in python with Swagger UI](https://hashnode.com/posts/build-an-easy-rest-api-in-python-with-swagger-ui/61ae038d9dc5a836391baab2)

[Shacoca](https://hashnode.com/@Shacoca)

[Dec 9, 2021](https://hashnode.com/posts/build-an-easy-rest-api-in-python-with-swagger-ui/61ae038d9dc5a836391baab2/comment/61b1fa9d6a81cf6b31dfc341)

Hi, Trying your example, I had CORS problem using the rest api. Found on [flask-cors.readthedocs.io/en/latest](https://flask-cors.readthedocs.io/en/latest/) : In the simplest case, initialize the Flask-Cors extension with default arguments in order to allow CORS for all domains on all routes.

```
from flask import Flask
from flask_cors import CORS

app = Flask(__name__)
CORS(app)
```

If it can help someone :)
