Created
March 17, 2016 15:32
-
-
Save ragingbal/49443613915765e8192e to your computer and use it in GitHub Desktop.
Sample flask controller with CORS support
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, send_file, send_from_directory | |
| from flask.ext.cors import CORS | |
| import GMLib | |
| app = Flask(__name__) | |
| CORS(app) | |
| @app.route("/") | |
| def hello(): | |
| return "Hello World!" | |
| @app.route('/list_providers') | |
| def list_providers(): | |
| return (GMLib.listProviders()) | |
| @app.route('/show_sample_config') | |
| def show_sample_Config(): | |
| return (GMLib.downloadSampleConfig('safeswiss')) | |
| @app.route('/start') | |
| def show_start(): | |
| return (GMLib.start()) | |
| @app.route('/upload_config') | |
| def upload_config(): | |
| return 'upload_config!' | |
| if __name__ == "__main__": | |
| app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment