how to have a single search API using path parameters (No form used)
问题 I have been using this view for searching a word as: db refers mongo connection (just for ref) @app.route('/') def index(): return render_template('index.html') @app.route('/words-<word>', methods=['GET', 'POST']) def wordsearch(word): collection_name=word[0].lower()+'_collection' words=db[collection_name] data=words.find({'word':word}) return render_template('wordsearch.html',data=data) In index.html template I have been doing this to match this above url as: <script type="text/javascript">