Compare commits

...

4 Commits

Author SHA1 Message Date
5bc7727323 Added logging handling
Signed-off-by: PartTimeHarmacist <harmacistant@icloud.com>
2022-08-29 20:23:02 -05:00
53e841e207 Added placeholder /oauth endpoint for testing purposes 2022-08-29 20:02:49 -05:00
b414061a78 Excluded http-client private environment files 2022-08-29 20:02:32 -05:00
2c24b7721f Added requirements file 2022-08-28 20:07:54 -05:00
3 changed files with 35 additions and 2 deletions

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
.idea/
venv/
static/
static/
http-client.private.*

28
app.py
View File

@ -1,12 +1,38 @@
from flask import Flask
import logging
from sys import stdout, stderr
from flask import Flask, request
app = Flask(__name__)
log = logging.getLogger()
stdout_handler = logging.StreamHandler(stdout)
stdout_handler.setLevel(logging.DEBUG)
stdout_handler.addFilter(lambda record: record.levelno <= logging.INFO)
stderr_handler = logging.StreamHandler(stderr)
stderr_handler.setLevel(logging.WARNING)
log.addHandler(stdout_handler)
log.addHandler(stderr_handler)
@app.route('/')
def hello_world(): # put application's code here
return "Welcome to the initial commit - there's nothing here right now..."
@app.route('/oauth')
def oauth_endpoint():
returned_state = request.args.get('state')
returned_code = request.args.get('code')
returned_error = request.args.get('error')
if returned_error:
return f"Oauth failed due to error: {returned_error}"
return f"Oauth Endpoint\nState: {returned_state}\nCode: {returned_code}"
if __name__ == '__main__':
app.run()

6
requirements.txt Normal file
View File

@ -0,0 +1,6 @@
click==8.1.3
Flask==2.2.2
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.1
Werkzeug==2.2.2