時間戳記與middleware使用練習。
在 log 印出以下資訊 :
- 伺服器請求的時間
- http方法
- 連線的url
- 從server接收到request到server送出response所需的時間
- Node.js v12.19.0
- Express v4.17.1
- Nodemon v2.0.6
- luxon v1.25.0
- response-time v2.3.2
- 開啟終端機,執行以下指令 :
- 進入專案資料夾
cd middleware-practice
- 安裝 npm & 透過 npm 安裝套件
npm install
- 使用腳本啟動專案
npm run dev
- 在瀏覽器進入 http://localhost:3000