-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
33 lines (22 loc) · 898 Bytes
/
app.py
File metadata and controls
33 lines (22 loc) · 898 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
from flask import Flask, render_template, request
from flask_cors import CORS
from routes.queues import queues_bp
app = Flask(__name__)
app.config["SECRET_KEY"] = "dev-secret-key"
# Habilitar CORS para permitir testes externos
CORS(app)
app.register_blueprint(queues_bp)
@app.route("/", methods=["GET", "POST"])
def home():
if request.method == "POST":
model = request.form.get("model")
lamb = request.form.get("arrival_rate")
mu = request.form.get("service_rate")
servers = request.form.get("servers")
capacity = request.form.get("capacity")
# Aqui futuramente chamaremos o QueueService para calcular
# Ex: result = QueueService.calculate(...)
return f"Modelo escolhido: {model}, λ={lamb}, μ={mu}, s={servers}, K={capacity}"
return render_template("home.html")
if __name__ == "__main__":
app.run(debug=True)