Skip to content

Instantly share code, notes, and snippets.

View jecanizarez's full-sized avatar

Juan Esteban Ortiz jecanizarez

  • Colombia
View GitHub Profile
@jecanizarez
jecanizarez / meow.md
Last active April 5, 2026 21:50
Mewgenics on Mac with Whisky

Settings CORS on Fast API

Remember you can set origins with regex!

image

Note: It's importat to set allow_credentials in True because it allows authentication headers like 'Authorization' or X-API-KEY.

Setting Cors on Flask Framework

Firts of all, we need to install flask-cors, you can do it with pip install -U flask-cors

On your main.py or init api file you can set origins and CORS configuration, an example:

image

Troubleshooting

[
{
"ID": 1,
"name": "Stephen Brock",
"phone": "1-582-813-7580",
"email": "nec.ante@protonmail.edu",
"country": "Costa Rica",
"region": "Cartago",
"city": "San Diego",
"category": "champions",
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
@jecanizarez
jecanizarez / products.json
Last active September 25, 2020 00:16
Products
[{
"nombre": "Scissors",
"tipo": "Utencilio",
"cantidad": 8,
"precio": 3000,
"proveedor": "Tijeras SA"
}, {
"nombre": "Spray",
"tipo": "Utencilios",
"cantidad": 25,