When to use next() and return next() in Node.js

As @Laurent Perrin’s answer: If you don’t do it, you risk triggering the callback a second time later, which usually has devastating results I give an example here if you write middleware like this: app.use((req, res, next) => { console.log(‘This is a middleware’) next() console.log(‘This is first-half middleware’) }) app.use((req, res, next) => { console.log(‘This … Read more

How to connect to MySQL from the command line

See here http://dev.mysql.com/doc/refman/5.0/en/connecting.html mysql -u USERNAME -pPASSWORD -h HOSTNAMEORIP DATABASENAME The options above means: -u: username -p: password (**no space between -p and the password text**) -h: host last one is name of the database that you wanted to connect. Look into the link, it’s detailed there! As already mentioned by Rick, you can avoid … Read more

tech