import * as express from 'express' ; import { signRequestForUpload } from '../aws-s3' ; const router = express . Router ( ) ; router . use ( ( req , res , next ) => { console . log ( 'team member API' , req . path ) ; if ( ! req . user ) { res . status ( 401 ) . json ( { error : 'Unauthorized' } ) ; return ; } next ( ) ; } ) ; router . post ( '/aws/get-signed-request-for-upload-to-s3' , async ( req , res , next ) => { try { const { fileName , fileType , prefix , bucket } = req . body ; const returnData = await signRequestForUpload ( { fileName , fileType , prefix , bucket } ) ; console . log ( returnData ) ; res . json ( returnData ) ; } catch ( err ) { next ( err ) ; } } ) ; export default router ;