From c804f5a1bf29b0ae2464dd58837046c99d571744 Mon Sep 17 00:00:00 2001 From: VALENTYN1974 Date: Tue, 20 Jun 2023 20:41:25 +0300 Subject: [PATCH] modified server.py --- final_project/server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/final_project/server.py b/final_project/server.py index a776f7ae3..ebfb7fac5 100755 --- a/final_project/server.py +++ b/final_project/server.py @@ -1,3 +1,4 @@ +import machinetranslation from machinetranslation import translator from flask import Flask, render_template, request import json @@ -8,17 +9,20 @@ def englishToFrench(): textToTranslate = request.args.get('textToTranslate') # Write your code here + "Translated text to French" = translator.english_to_french() return "Translated text to French" @app.route("/frenchToEnglish") def frenchToEnglish(): textToTranslate = request.args.get('textToTranslate') # Write your code here + "Translated text to English" = translator.french_to_english() return "Translated text to English" -@app.route("/") +@app.route("/index") def renderIndexPage(): # Write the code to render template + return render_index('index.html') if __name__ == "__main__": app.run(host="0.0.0.0", port=8080)