17 lines
507 B
Python
17 lines
507 B
Python
|
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())
|