cors init

This commit is contained in:
='fauz 2025-07-02 12:00:16 +07:00
parent b10465e353
commit 6d712685d5
3 changed files with 2 additions and 4 deletions

View File

@ -1,5 +1,6 @@
from flask import Flask
from app.routes import main
from flask_cors import CORS
import os
def create_app():
@ -7,5 +8,6 @@ def create_app():
template_path = os.path.join(base_dir, '..', 'templates')
static_path = os.path.join(base_dir, '..','static')
app = Flask(__name__, template_folder=template_path, static_folder=static_path)
CORS(app, resources={r"/api/*": {"origins": "*"}})
app.register_blueprint(main)
return app

4
run.py
View File

@ -1,9 +1,5 @@
from app import create_app
from flask_cors import CORS
app = create_app()
CORS(app)
def swap_latlon(coords):
return [
[ # Polygon