from flask import Flask, jsonify, request
from .chain import DocumentChain
from .storage import DiskStorage

app = Flask(__name__)
chain = DocumentChain(DiskStorage('data/'))

@app.route('/entries', methods=['GET', 'POST'])
def entries():
    if request.method == 'POST':
        if not request.json:
            return '', 400
        id = chain.add(request.json)
        res = jsonify({"id": id})
        res.status_code = 201
        return res
    else:
        return jsonify({'entries': [e.serialize() for e in chain.all()]})

@@ -225,19 +225,22 @@
 def entr
-ies
+y_list
 ():%0A    
@@ -528,8 +528,141 @@
 ll()%5D%7D)%0A
+%0A%0A@app.route('/entries/%3Centry_id%3E', methods=%5B'GET'%5D)%0Adef entry_detail(entry_id):%0A    return jsonify(chain.get(entry_id).serialize())%0A

Add entry detail HTTP endpoint