This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install --save-dev nodemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"events": { | |
"start": "clear" | |
}, | |
"delay": "2500" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts": { | |
"start": "node ./bin/www", | |
"start:dev": "DEBUG=nodejs-mysql:* nodemon ./bin/www" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nodemon delay 2 index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install -g nodemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nodemon -e js,sql index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example app listening at http://localhost:3004 | |
Loglevel is simple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example app listening at http://localhost:3003 | |
{"level":30,"time":1611695678813,"pid":32768,"hostname":"abcd","req":{"id":1,"method":"GET","url":"/api/test","headers":{"host":"localhost:3003","connection":"keep-alive","sec-ch-ua":"\"Google Chrome\";v=\"87\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"87\"","sec-ch-ua-mobile":"?0","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","sec-fetch-site":"none","sec-fetch-mode":"navigate","sec-fetch-user":"?1","sec-fetch-dest":"document","accept-encoding":"gzip, deflate, br","accept-language":"en-GB,en-US;q=0.9,en;q=0.8","cookie":"_ga=GA1.1.1863215728.1591927460; PPA_ID=gkq1qhp7htr141pkojpmqcqt95; webfx-tree-cookie-persistence=wfxt-4; io=TxK-RQvnHb14VONKAAAC","if-none-match":"W/\"19-JzA5ewGlTSyvFTwS4fIYMkA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example app listening at http://localhost:3001 | |
{"meta":{},"level":"\u001b[32minfo\u001b[39m","message":"GET /api/test 304 2ms"} | |
{"meta":{},"level":"\u001b[32minfo\u001b[39m","message":"GET /favicon.ico 404 2ms"} | |
{"meta":{},"level":"\u001b[32minfo\u001b[39m","message":"GET /favicon.ico 404 1ms"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const winston = require('winston'); | |
const expressWinston = require('express-winston'); | |
const express = require('express'); | |
const app = express(); | |
const port = 3001; | |
//more options here - https://github.com/bithavoc/express-winston#request-logging | |
app.use(expressWinston.logger({ | |
transports: [ | |
new winston.transports.Console() |