-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
30 lines (20 loc) · 908 Bytes
/
main.py
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
from fastapi import Depends, FastAPI
from controller import tweet_controller, user_controller
from repository.implementation.in_memory_tweet_repository import InMemoryTweetRepository
from repository.implementation.in_memory_user_repository import InMemoryUserRepository
from service.tweet_service import TweetService
from service.user_service import UserService
user_repository = InMemoryUserRepository()
tweet_repository = InMemoryTweetRepository()
user_service = UserService(user_repository)
tweet_service = TweetService(tweet_repository)
app = FastAPI()
user_controller = user_controller.UserController(user_service)
tweet_controller = tweet_controller.TweetController(tweet_service)
user_router = user_controller.router
tweet_router = tweet_controller.router
app.include_router(user_router)
app.include_router(tweet_router)
@app.get("/")
async def root():
return {"message": "Hello World"}