The HTTP TRACE method performs a message loop-back test along the path to the target resource, providing a useful debugging mechanism. The final recipient of the request should reflect the message received back to the client as the message body of a 200 (OK) response with a Content-Type of message/http.
Example of an HTTP request with the TRACE method:
Example of a response to a request with the TRACE method:
const path = require( 'path' );
const express = require( 'express' ); // version 4.x
const favicon = require( 'serve-favicon' );
const app = express();
app .use( favicon( path.join( __dirname, 'assets', 'logo.ico' ) ) );
app.trace( '*', ( req, res ) => {
// how do I return the entire request in its original form in response?
} );