import { IRouter } from "./Router" ; import { Picture } from "../Database" ; import { Response } from "express" ; export class AddPictureRouter implements IRouter { public AddRoute ( route ) { route . post ( '/add/' , ( request , response ) => { const picture = new Picture ( request . body ) ; picture . save ( ( err , picture ) => { if ( err ) { response . send ( err ) ; } response . json ( picture ) ; } ) ; } ) ; } }