Add /log to path so I could use it on server.

This commit is contained in:
Matt
2020-05-19 22:41:10 -05:00
parent 3882f914cd
commit 0a153a50aa
2 changed files with 8 additions and 4 deletions

6
app.py
View File

@ -27,7 +27,7 @@ def get_password(username):
def unauthorized():
return make_response(jsonify({'error': 'Unauthorized access'}), 403)
@app.route('/new', methods=['POST', 'GET'])
@app.route('/log/new', methods=['POST', 'GET'])
@auth.login_required
def create_status():
# At least try to clean up user-submitted data
@ -52,11 +52,11 @@ def create_status():
return jsonify({'status': status}), 201
@app.route('/raw', methods=['GET'])
@app.route('/log/raw', methods=['GET'])
def get_statuses_raw():
return jsonify({'statuses': statuses[::-1]})
@app.route('/', methods=['GET'])
@app.route('/log', methods=['GET'])
def get_statuses():
long_agos = [humanfriendly.format_timespan(datetime.datetime.now().timestamp() - status['timestamp']) for status in statuses[::-1]]
return render_template("index.html",