matthews-totw/app.py

17 lines
507 B
Python
Raw Normal View History

2024-09-11 21:20:56 -05:00
from flask import Flask, render_template
import requests
import logging
from werkzeug.exceptions import abort
app = Flask(__name__)
@app.route('/')
def index():
tool = requests.get("http://10.0.100.183:8080/api/v0/tooloftheweek")
return render_template('index.html', tool=tool.json())
@app.route('/<int:tool_week_id>')
def tool_by_week(tool_week_id):
tool = requests.get("http://10.0.100.183:8080/api/v0/toolbyweek/" + tool_week_id)
return render_template('index.html', tool=tool.json())