Created
January 24, 2018 19:07
-
-
Save ajpen/711cbda7f8d57e7822608ba35fb04f58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask | |
| from background import data_valid, process | |
| app = Flask(__name__) | |
| @app.route("/") | |
| def hello(): | |
| data = request.args.to_dict() | |
| if data_valid(data): | |
| # run a time consuming task | |
| process(data) | |
| return ("", 200) | |
| else: | |
| return ("data invalid", 400) | |
| if __name__ == "__main__": | |
| app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment