chg: [api] favicon added

main
Alexandre Dulaunoy 2021-05-22 15:25:41 +02:00
parent 3b3e66df43
commit 15b46edb58
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
1 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,7 @@
version = "0.1"
from flask import Flask
from flask import Flask, url_for, send_from_directory
from flask_restx import Resource, Api
import os
app = Flask(__name__)
app.url_map.strict_slashes = False
@ -26,5 +27,10 @@ class generateUUID(Resource):
r.incr(k, 1)
return "{}".format(genuuid)
@api.route('/favicon.ico', doc=False)
class favicon(Resource):
def get(self):
return send_from_directory(os.path.join(app.root_path, 'static'),'favicon.ico',mimetype='image/vnd.microsoft.icon')
if __name__ == '__main__':
app.run()