from src.controller.user import * from src.middleware.auth import AuthMiddleware from core.router import Router # Normal user for sano user_router = Router() user_router.post("/login", login) user_router.post("/register", register) user_router.get("/profile", AuthMiddleware(), get_profile)
from src.controller.category import * from core.router import Router category_router = Router() category_router.get("", get_all_categories) category_router.get("/<int:category_id>", get_category_by_id)
from src.controller.activity import * from core.router import Router activity_router = Router() activity_router.get("", get_all_activities)
from core.router import Router from src.controller.event import * event_router = Router() event_router.get("", get_available_events) event_router.get("/<int:event_id>", get_event_by_id)
from core.router import Router from src.controller.routine import * routine_router = Router() routine_router.get("", get_routines) routine_router.get("/<int:routine_id>", get_routine_by_id)
from handler.scholar import routes as scholar_routes from handler.scholar_app import routes as scholar_app_routes from handler.sponsor_app import routes as sponsor_app_routes from handler.board import routes as board_routes from core.router import Router from flask import Flask from flask_cors import CORS app = Flask(__name__) CORS(app) router = Router(app) router.get('/', lambda: 'Hello World!') router.group('/scholar', scholar_routes) router.group('/scholar_app', scholar_app_routes) router.group('/sponsor_app', sponsor_app_routes) router.group('/board', board_routes) if __name__ == '__main__': router.execute() app.run(port=8888)
from core.router import Router from src.controller.schedule import * schedule_router = Router() schedule_router.get("/<int:schedule_id>", get_schedule_by_id)
from core.router import Router from src.controller.location import * from src.controller.marathon import * location_router = Router() location_router.post("/marathon", add_marathon) location_router.get("/<int:location_id>", get_location_by_id) location_router.get("/search", search_location)