This commit is contained in:
2024-08-10 20:26:57 +02:00
commit 62f3ae7881
21 changed files with 189 additions and 0 deletions

View File

View File

@@ -0,0 +1,3 @@
class MainController:
def index(self):
return {'message':'Hello, World!'}

View File

@@ -0,0 +1,10 @@
import unittest
import json
from app.modules.main.controller import MainController
def test_index():
main_controller = MainController()
result = main_controller.index()
assert result == {'message': 'Hello, World!'}

11
app/modules/main/route.py Normal file
View File

@@ -0,0 +1,11 @@
from flask import Blueprint, make_response, jsonify
from .controller import MainController
main_bp = Blueprint('main', __name__)
main_controller = MainController()
@main_bp.route('/')
def index():
result=main_controller.index()
return make_response(jsonify(data=result))