Purposefully throwing errors can have several negative side effects to the readability and traceability of your code. In this article, we take a look at an alternative to how to handle errors within your Node.js + TypeScript applications. Do you ever find yourself wondering where exactly you should throw an error to be consumed by… Continue reading Error Handling without the Result Class
Tag: nodejs
Securing Node.js in Production: Expert Practices for Every Developer
As web development keeps evolving, ensuring the security of your Node.js application becomes critical. This detailed guide steps beyond elementary suggestions, offering a closer look at advanced security techniques for Node.js setups. 1. Operating Without Root Privileges: A Must-Do Running Node.js or any web server as a root user poses a significant security risk. A… Continue reading Securing Node.js in Production: Expert Practices for Every Developer
Build a Caching Layer in Node.js With Redis
Your Node.js backend is slow? Speed it up by caching responses and start returning them immediately. This will also drastically increase the number of users who can simultaneously access your site. The problem is that the basic approach to caching in Node.js involves spreading read and write caching operations across the business logic. This leads… Continue reading Build a Caching Layer in Node.js With Redis
Best Practices for Securing Node.js Applications in Production
Node.js is one of the favorite technologies for developers when it comes to backend development. Its popularity keeps rising and is now one of the main targets of online attacks. That is why it is crucial to secure Node.js from vulnerabilities and threats. In this guide, you will see the 15 best practices for devising… Continue reading Best Practices for Securing Node.js Applications in Production
Understanding the Phases of Node.js: A Comprehensive Guide
Node.js, a powerful and versatile JavaScript runtime, is widely used for building scalable and high-performance applications. One key aspect that sets Node.js apart is its event-driven, non-blocking I/O model, which is orchestrated through a series of phases. In this article, we will delve into the various phases of Node.js and explore how they contribute to… Continue reading Understanding the Phases of Node.js: A Comprehensive Guide
How to use JSON web tokens with Node.js ?
JSON Web Token (JWT) is an Internet Standard that is used for exchanging data between two parties in a secure manner. It can’t be easily hacked as it creates a digital signature with the secret key along with the HMAC algorithm). JWT Structure: JSON Web Tokens consist of three parts separated by dots (xxxxx.yyyyy.zzzzz), which are: Header: This… Continue reading How to use JSON web tokens with Node.js ?
The Sequelize include option
The Sequelize include option is commonly added in a model finder method (findOne(), findAll(), etc.)This option is used to add a JOIN clause to the generated SQL query, enabling you to retrieve data from multiple tables with one query.For example, suppose you have two related SQL tables named Cities and Countries.Each Cities row stores the information of which country it belongs to with the CountryId column as… Continue reading The Sequelize include option
Confirm a stripe PaymentIntent using node js
After the PaymentIntent is created, attach a payment method and confirm to continue the payment. Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps,the PaymentIntent will transition to the requires_action status and suggest… Continue reading Confirm a stripe PaymentIntent using node js