File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright Contributors to the Packit project.
2+ # SPDX-License-Identifier: MIT
3+
4+ from logging import getLogger
5+
6+ from flask import Blueprint
7+ from flask_cors import CORS
8+
9+
10+ logger = getLogger ("packit_dashboard" )
11+ api = Blueprint (
12+ "api" ,
13+ __name__ ,
14+ )
15+ CORS (api )
16+
17+
18+ @api .route ("/api/" , defaults = {"path" : "" })
19+ @api .route ("/api/<path:path>" )
20+ def drop (path ):
21+ return ("" , 421 )
Original file line number Diff line number Diff line change 66from flask import Flask
77from flask_talisman import Talisman
88
9+ from packit_dashboard .api .routes import api
910from packit_dashboard .home .routes import home
1011
1112app = Flask (
1617# Note: Declare any other flask blueprints or routes above this.
1718# Routes declared below this will be rendered by React
1819app .register_blueprint (home )
20+ app .register_blueprint (api )
1921
2022
2123# Enable CSP and HSTS
You can’t perform that action at this time.
0 commit comments