from rest_api import app if __name__ == '__main__': app.run(debug=True)
# -*- coding: utf-8 -*- """ REST API - WSGI entry point Author(s): Adam Mitchell, [email protected] """ from rest_api import app if __name__ == "__main__": app.run(host='0.0.0.0', port=80, debug=True)
from rest_api import app import sys if __name__ == '__main__': sys.setdefaultencoding('utf-8') app.run(port=5000, debug=True)
from rest_api import app app.run(host="0.0.0.0", port=8080)
from rest_api import app if __name__ == "__main__": app.run()
token = request.args.get('token') print token if token is not None: username,password = token.split(":") # naive token user_entry = User.get(username) if (user_entry is not None): user = User(user_entry[0],user_entry[1]) if (user.password == password): return user return None @app.route("/",methods=["GET", "ORIGIN"]) @cross_origin() def index(): return Response(response="Hello World!",status=200) @app.route("/protected/",methods=["GET", "ORIGIN"]) @cross_origin() @login_required def protected(): return Response(response="Hello Protected World!", status=200) if __name__ == '__main__': app.config["SECRET_KEY"] = "ITSASECRET" app.run(port=5000,debug=True)
from rest_api import app from rest_api_config import config if __name__ == "__main__": app.run(host=config.CONFIG_HTTP_HOST, port=config.CONFIG_HTTP_PORT, threaded=True, debug=False)