From fefcf3522e2bd5c5d8064f155f62e7440bad9d89 Mon Sep 17 00:00:00 2001 From: Misha Wolfson Date: Thu, 15 Dec 2016 17:56:28 -0500 Subject: [PATCH] Display the request method in the log: don't assume GET --- lib/spserver.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/spserver.js b/lib/spserver.js index b9f7e55..b80d982 100644 --- a/lib/spserver.js +++ b/lib/spserver.js @@ -77,12 +77,13 @@ var spserver = function (settings) { var base = generateBase(path.resolve(finalSettings.file), finalSettings); var server = http.createServer(function (req, res) { - logger.debug('[REQ] GET:', req.url); + logger.debug('[REQ]', req.method + ':', req.url); var startTime = new Date().getTime(); var done = function () { var requestTime = new Date().getTime() - startTime; - logger.debug('[RES] GET:', req.url, '(' + res.statusCode + ') took', requestTime, 'ms'); + logger.debug('[RES]', req.method + ':', req.url, + '(' + res.statusCode + ')', 'took', requestTime, 'ms'); }; res.addListener('finish', done);