Basic app using Flask

This commit is contained in:
youen 2022-08-09 17:30:52 +02:00 committed by Youen
parent 121d409643
commit 0d607e63a2
4 changed files with 24 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/venv
__pycache__

4
debug.sh Executable file
View File

@ -0,0 +1,4 @@
!#/bin/sh
source venv/bin/activate
flask --app src/app --debug run

8
src/api/document.py Normal file
View File

@ -0,0 +1,8 @@
from flask import Blueprint, request
bp = Blueprint('document', __name__, url_prefix='/api/doc')
@bp.route('/build')
def build():
return '<p>Building '+request.args.get('doc')+'@'+request.args.get('branch')+' ...</p>'

10
src/app.py Normal file
View File

@ -0,0 +1,10 @@
from flask import Flask
def create_app():
app = Flask(__name__)
from api import document
app.register_blueprint(document.bp)
return app