-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
25 lines (21 loc) · 739 Bytes
/
app.py
File metadata and controls
25 lines (21 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
from flask import Flask, request
from flask_cors import CORS
from postTranslation.azure import translate_text
from postTranslation.translate import translate_text
from IR.news import google_search
from IR.webQuery import get_news
import hello
from waitress import serve
app = Flask(__name__)
CORS(app)
print('Starting server...')
app.add_url_rule('/azureTranslation', view_func=translate_text)
app.add_url_rule('/translate', view_func=translate_text)
app.add_url_rule('/searchWeb', view_func=google_search)
app.add_url_rule('/news', view_func=get_news)
app.add_url_rule('/', view_func=hello.hello)
if __name__ == '__main__':
port = int(os.environ.get('PORT', 5000))
serve(app, host='0.0.0.0', port=port)
# app.run()