-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (29 loc) · 1010 Bytes
/
main.py
File metadata and controls
36 lines (29 loc) · 1010 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
25
26
27
28
29
30
31
32
33
34
35
36
from os import environ
from dotenv import load_dotenv
from flask import Flask
from flask_cors import CORS
from admin.views import admin
from auth.views import auth
from dashboard.dash import dashboard
from products.views import products
from sales.views import sales
from user.views import users
# Carregando variáveis de ambiente
load_dotenv()
# Inicializando o aplicativo Flask
app = Flask(__name__)
CORS(app, origins="*")
app.config["CORS_HEADERS"] = "Content-Type"
app.config["SECRET_KEY"] = environ.get("SECRET_KEY", ":^)")
# Registrando blueprints
app.register_blueprint(auth, url_prefix="/auth")
app.register_blueprint(users, url_prefix="/users")
app.register_blueprint(products, url_prefix="/prods")
app.register_blueprint(dashboard, url_prefix="/dash")
app.register_blueprint(sales, url_prefix="/sales")
app.register_blueprint(admin, url_prefix="/admin")
@app.get("/")
def home():
return "FishNet API"
if __name__ == "__main__":
app.run(debug=True)