Want an UPSERT function for PostgreSQL in nodejs? Here’s one for you that can work for a single entry as well as multiple entries.
Category: Nodejs
Nodejs Express Common Configurations
Have an app based on nodejs express? Here are some common configurations that may come in handy during development for scale.
Implementing websocket server with Nodejs express clusters
Have an existing Nodejs app with express clusters and wish to integrate websocket server? Learn how to achieve that integration in this post.
How to handle promise rejections in Async Await
A promise in JavaScript can be resolved if the code execution completed as expected, or it can be rejected if there are any errors. When using async await, you may be awaiting a promise, but if something goes wrong, then you may get an ‘Unhandled Promise Rejection’ error. This happens because each promise rejection needs… Continue reading How to handle promise rejections in Async Await
Sending non-English text via HTTP in NodeJS
Have non-English characters (Hindi, Japanese, etc.) in your HTTP request body in Nodejs? Chances are that your requests are failing. Here’s the fix.
How to use cookies in backend API calls
Getting a 302 status code with the “Object moved to here” response when making an API call? Perhaps you are missing a cookie. Learn how to fix that.
Nodejs express – Persist variables across the app life
Want your dynamic variables to retain their values throughout the lifecycle of an app, across child processes, in nodejs express? Learn how.