13 lines
419 B
Python
13 lines
419 B
Python
from fastapi import APIRouter, Depends
|
|
from typing import List
|
|
from schemas.movie import MovieSchema
|
|
from helpers.movie_helpers import get_all_movies
|
|
from sqlalchemy.orm import Session
|
|
from core.database import get_db
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/movieapp", status_code=200, response_model=List[MovieSchema])
|
|
async def get_movies(db: Session = Depends(get_db)):
|
|
movies = get_all_movies(db)
|
|
return movies |