diff --git a/redstring/server.py b/redstring/server.py index 864aa9a..0dd0d4a 100644 --- a/redstring/server.py +++ b/redstring/server.py @@ -23,18 +23,18 @@ CONFIG_ENVVAR = 'REDSTRING_CONFIG' app = Flask(__name__) -@app.route('/') +@app.route('/', methods=['GET']) def root(): return redirect(url_for('index')) -@app.route('/index/') +@app.route('/index/', methods=['GET']) def index(): document = generate_index_document(current_app.config['root']) return render_template('doc.jinja', document=document, index=True) -@app.route('/doc/') +@app.route('/doc/', methods=['GET']) def document(document_id): doc_path = safe_join(current_app.config['root'], f'{document_id}.json') if not os.path.isfile(doc_path): @@ -44,7 +44,7 @@ def document(document_id): return render_template('doc.jinja', document=doc, index=False) -@app.route('/new/') +@app.route('/new/', methods=['GET']) def new(): document_id = 'new' new_doc = generate_default_document(document_id)