import { Request , Response } from 'express' ; import { BasicRouter } from '../BasicRouter' ; import { getHeaders } from '../../utils/headers' ; import { IProxyContext , IProxySettings } from '../interfaces' ; export class RestDeleteRouter extends BasicRouter { constructor ( context , settings ) { super ( context , settings ) ; } public router = ( req , res ) : void => { const endpointUrl = this . url . apiEndpoint ( req ) ; this . logger . info ( '\nDELETE: ' + endpointUrl ) ; const headers = getHeaders ( req . headers ) ; this . sp . fetch ( endpointUrl , { method : 'DELETE' , headers } ) . then ( this . handlers . isOK ) . then ( this . handlers . response ( res ) ) . catch ( this . handlers . error ( res ) ) ; } ; }