import * as express from 'express' ; import publicExpressRoutes from './public' ; import teamMemberExpressRoutes from './team-member' ; function handleError ( err , _ , res , __ ) { console . error ( err . stack ) ; res . json ( { error : err . message || err . toString ( ) } ) ; } export default function api ( server ) { server . use ( '/api/v1/public' , publicExpressRoutes , handleError ) ; server . use ( '/api/v1/team-member' , teamMemberExpressRoutes , handleError ) ; }