From afeaf3647906a2f183ec3b395f222f99117f4a59 Mon Sep 17 00:00:00 2001 From: Caio1w <206350051+Caio1w@users.noreply.github.com> Date: Wed, 29 Oct 2025 21:48:22 -0300 Subject: [PATCH] servir a index.html a rotas --- app/app.py | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/app/app.py b/app/app.py index 82e97e8..c64e13a 100644 --- a/app/app.py +++ b/app/app.py @@ -1,4 +1,4 @@ -from flask import Flask, request, jsonify +from flask import Flask, request, jsonify, send_file from flask_cors import CORS from pymongo import MongoClient from datetime import datetime, timedelta @@ -76,10 +76,40 @@ def init_default_categories(user_id): }) if categories: categories_collection.insert_many(categories) +@app.route('/') +def serve_html_home(): + return send_file('../web/assets/index.html') +@app.route('/dashboard') +def serve_html_dashboard(): + return send_file('../web/assets/index.html') + +@app.route('/login') +def serve_html_login(): + return send_file('../web/assets/index.html') + +@app.route('/cadastro') +def serve_html_cadastro(): + return send_file('../web/assets/index.html') + +@app.route('/transacoes') +def serve_html_transacoes(): + return send_file('../web/assets/index.html') + +@app.route('/configuracoes') +def serve_html_configuracoes(): + return send_file('../web/assets/index.html') + +@app.route('/about') +def serve_html_about(): + return send_file('../web/assets/index.html') + +@app.route('/help') +def serve_html_help(): + return send_file('../web/assets/index.html') # ROTAS DE AUTENTICAÇÃO @app.route('/api/auth/register', methods=['POST']) -def register(): +def register(): try: data = request.get_json() email = data.get('email', '').strip().lower()