Repository

The repository is also implemented with TypeORM:

import { getConnection } from "typeorm"; 

import { Movie } from "../entities/movie"; 

export function getRepository() { 
    const conn = getConnection(); 
    const movieRepository = conn.getRepository(Movie); 
    return movieRepository; 
} 

Get Learning TypeScript 2.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.