import { IRouter } from "./Router" ; import { Picture } from "../Database" ; import { Request , Response } from "express" ; export class FindByIdRouter implements IRouter { public AddRoute ( route ) { route . get ( '/id/:id' , ( request , response ) => { Picture . findOne ( { _id : request . params . id } , '-_id' , ( err , picture ) => { if ( err ) { response . send ( err ) ; } response . json ( picture ) ; } ) ; } ) ; } }