Browse Source

Basic app using Flask

master
youen 2 years ago committed by Youen
parent
commit
0d607e63a2
  1. 2
      .gitignore
  2. 4
      debug.sh
  3. 8
      src/api/document.py
  4. 10
      src/app.py

2
.gitignore vendored

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

4
debug.sh

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

8
src/api/document.py

@ -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

@ -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
Loading…
Cancel
Save