finish up lookups
This commit is contained in:
parent
2affb0f7b0
commit
ec9d6bd28c
2 changed files with 8 additions and 4 deletions
10
app/app.py
10
app/app.py
|
@ -1,4 +1,4 @@
|
|||
from flask import Flask, render_template, send_from_directory
|
||||
from flask import Flask, render_template, send_from_directory, request, redirect
|
||||
import rfc2229
|
||||
import configparser
|
||||
|
||||
|
@ -10,9 +10,13 @@ port = config['server']['port']
|
|||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/')
|
||||
@app.route('/', methods=['GET', 'POST'])
|
||||
def home():
|
||||
return render_template('index.j2', server="everypizza.im dictd 1.13.3/rf on Linux 6.13.7-arch1-1")
|
||||
if request.method == 'POST':
|
||||
word = request.form['input']
|
||||
return redirect(f'/define/{word}')
|
||||
else:
|
||||
return render_template('index.j2', server=server)
|
||||
|
||||
@app.route('/about')
|
||||
def about():
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z" />
|
||||
</svg>
|
||||
</div>
|
||||
<input type="text" id="input"
|
||||
<input type="text" id="input" name="input"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
||||
placeholder="Search a word..." required />
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue