在路由中加入 middleware,讓伺服器接到瀏覽器傳來的 HTTP request時,會自動把資訊記錄到 server log 中
- server log會記錄以下:
- 時間戳記 (time-stamps) - 以當地時間 (台北) 顯示
- HTTP request Method
- URL
- Node.js
- express
$git clone https://github.com/ywcwy/middleware_server-request-timing.git
After download,
$cd middleware_server-request-timing // to install the following Packages under this directory
$npm init -y // create and initialize package.json directory
$npm install // install all the Packages
$npm run dev
App running on port 3000 // if start working, termianl will show this message