You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
501 B
Python
31 lines
501 B
Python
2 years ago
|
from flask import Flask, render_template, jsonify
|
||
|
import random
|
||
|
from datetime import datetime
|
||
|
import json
|
||
|
import os
|
||
|
|
||
|
app = Flask('app')
|
||
|
|
||
|
|
||
|
@app.route('/')
|
||
|
|
||
|
def index():
|
||
|
return render_template('index.html')
|
||
|
|
||
|
@app.route('/api/datapoint')
|
||
|
|
||
|
def api_datapoint():
|
||
|
|
||
|
metaDict = open('meta.json',)
|
||
|
meta = json.load(metaDict)
|
||
|
|
||
|
|
||
|
dictionary_to_return = {
|
||
|
'meta': meta,
|
||
|
# 'pics': pics
|
||
|
}
|
||
|
|
||
|
return jsonify(dictionary_to_return)
|
||
|
|
||
|
|
||
|
app.run(host='0.0.0.0', port=8080, debug=True)
|