Initial
This commit is contained in:
0
app/modules/main/__init__.py
Normal file
0
app/modules/main/__init__.py
Normal file
3
app/modules/main/controller.py
Normal file
3
app/modules/main/controller.py
Normal file
@@ -0,0 +1,3 @@
|
||||
class MainController:
|
||||
def index(self):
|
||||
return {'message':'Hello, World!'}
|
||||
10
app/modules/main/main_tests.py
Normal file
10
app/modules/main/main_tests.py
Normal 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
11
app/modules/main/route.py
Normal 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))
|
||||
Reference in New Issue
Block a user