-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
46 lines (31 loc) · 909 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import os
from flask import Flask, render_template, send_from_directory
from utils import *
from flask_restful import Api
app = Flask(__name__)
api = Api(app)
api.add_resource(API_point, '/api')
def main():
# db_session.global_init("db/blogs.sqlite")
# app.register_blueprint(api_files.blueprint)
app.run(
port=1400,
# host=gv.host
)
@app.route('/favicon.ico')
def favicon():
return send_from_directory(os.path.join('static', 'img'),
'favicon.ico', mimetype='image/vnd.microsoft.icon')
@app.route('/robots.txt')
def robots():
return send_from_directory("templates", "robots.txt")
@app.route("/plain")
def curl():
return generate_phrase()
@app.route("/")
@app.route("/index")
@app.route("/index.html")
def graphical():
return render_template("gui.html", text=generate_phrase())
if __name__ == '__main__':
main()