Backend more
This commit is contained in:
parent
43043a08e9
commit
1fe4a6dafe
2 changed files with 22 additions and 15 deletions
|
@ -79,11 +79,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Input section: Where user input is provided -->
|
<!-- Input section: Where user input is provided -->
|
||||||
<div class="input">
|
<form class="input" method="POST" action="">
|
||||||
<input type="text" placeholder="Type your message here..." />
|
<input type="text" name="name" placeholder="Type your message here..." />
|
||||||
<button><img src="/static/img/microphone.svg" alt="microphone"></button>
|
<button type="submit" name="option" value="voice"><img src="/static/img/microphone.svg" alt="microphone"></button>
|
||||||
<button>Send</button>
|
<button type="submit" name="option" value="chat">Send</button>
|
||||||
</div>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,21 @@
|
||||||
from flask import Flask, send_from_directory
|
from flask import Flask, request
|
||||||
|
|
||||||
|
APP = Flask(__name__)
|
||||||
|
|
||||||
|
|
||||||
class WebHost:
|
@APP.route('/', methods=['GET', 'POST'])
|
||||||
@staticmethod
|
def index():
|
||||||
def main_page():
|
if request.method == 'POST':
|
||||||
app = Flask(__name__)
|
name = request.form['name']
|
||||||
|
option = request.form['option']
|
||||||
|
|
||||||
@app.route('/')
|
if option == "voice":
|
||||||
def index():
|
print(name)
|
||||||
return app.send_static_file('index.html')
|
elif option == "chat":
|
||||||
|
print(name)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
return APP.send_static_file('index.html')
|
||||||
app.run(debug=True)
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
APP.run(debug=True)
|
Loading…
Reference in a new issue