Created
April 5, 2020 20:30
-
-
Save bgweber/7f6693ab831c85b207302d5c2349c5ff to your computer and use it in GitHub Desktop.
This file contains 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 flask_httpauth import HTTPTokenAuth | |
app = Flask(__name__) | |
auth = HTTPTokenAuth(scheme='Token') | |
@auth.verify_token | |
def verify_token(token): | |
return '1234567890abcdefg' == token | |
@app.route('/', methods=["GET","POST"]) | |
@auth.login_required | |
def index(): | |
return "Hello World!" | |
if __name__ == '__main__': | |
app.run(host='0.0.0.0', port=8000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment