aboutsummaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2022-03-22 00:39:40 +0800
committerJesús <heckyel@hyperbola.info>2022-03-22 00:39:40 +0800
commit3fca03988b42adaf8e67cc7137dd1fdba327e197 (patch)
treead39a5bc12a03c82b9a4fd980c1b92ca0a1dac93 /main.py
downloadheroeapi-3fca03988b42adaf8e67cc7137dd1fdba327e197.tar.lz
heroeapi-3fca03988b42adaf8e67cc7137dd1fdba327e197.tar.xz
heroeapi-3fca03988b42adaf8e67cc7137dd1fdba327e197.zip
initial commit
Diffstat (limited to 'main.py')
-rw-r--r--main.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/main.py b/main.py
new file mode 100644
index 0000000..a313cac
--- /dev/null
+++ b/main.py
@@ -0,0 +1,24 @@
+"""
+Provides heroes API
+"""
+from flask import Flask
+from flask_jwt_extended import JWTManager
+from config import settings
+from database.db import initialize_db
+from routes.heroes import heroes
+from routes.users import users
+from routes.auth import auth
+
+
+app = Flask(__name__)
+app.config.from_object(settings['development'])
+app.register_blueprint(heroes, url_prefix="/api/v1/")
+app.register_blueprint(users, url_prefix="/api/v1/")
+app.register_blueprint(auth, url_prefix="/api/v1/")
+initialize_db(app)
+
+jwt = JWTManager(app)
+
+
+if __name__ == '__main__':
+ app.run()