Year: 2018

  • Node Postgres Insert Multiple Rows

    You might be wondering how to insert multiple rows into a table using Node Postgres. Most examples show adding only one row at a time. Some solutions recommend using a control flow library like async. But this technique is slow and inefficient because it uses too many connections or sends the queries one by one.…

  • Async Await for Passport.js Authentication in Express.js

    The goal of this blog post is for you to know exactly how to implement the LocalStrategy for PassportJS using async/await patterns in your express.js application. In the passport.js documentation one of the first steps to getting started is to implement your first "strategy" and register it with passport. var passport = require(‘passport’) , LocalStrategy = require(‘passport-local’).Strategy;…