Skip to content

Instantly share code, notes, and snippets.

@ragingbal
Created March 17, 2016 15:32
Show Gist options
  • Select an option

  • Save ragingbal/49443613915765e8192e to your computer and use it in GitHub Desktop.

Select an option

Save ragingbal/49443613915765e8192e to your computer and use it in GitHub Desktop.
Sample flask controller with CORS support
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