I'm trying to do a restful api in flask and python. Here's my code:
from flask import Flask, jsonify, request, render_template
from flask_restful import Api, Resource
app = Flask(__name__)
api = Api(app)
class Tracks(Resource):
@app.route('/')
def get(self):
test = {
"name": "json2html",
"description": "Converts JSON to HTML tabular representation"
}
return jsonify(test)
api.add_resource(Tracks, '/tracks')
if __name__ == '__main__':
app.run(port='5002')
My question is how should I modify it to be able to display my returned value in table and add e.g. some CSS. Thanks!
