Generate a PDF from HTML with puppeteer

In this post, we gonna use Puppeteer to generate PDF files from HTML. With Puppeteer we can also generate screenshots. What is Puppeteer? The documentation says: Puppeteer is a Node library that provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default but can be configured to… Continue reading Generate a PDF from HTML with puppeteer

Express js upload and save base64 image into File System

Azure CSP – Partner Center authentication with Node JS

In this post, I will show you Azure CSP partner center authentication with Node JS. We gonna use express JS as an application framework and the Request module to make HTTP calls to Azure REST APIs. Initiate the project with npm init –yes, it will create a file called package.json in the current folder. Now… Continue reading Azure CSP – Partner Center authentication with Node JS

Send Email using SendGrid in Express.JS application

In this arti­cle, I will demon­strate a sim­ple exam­ple of send­ing emails using SendGrid in Express/ Node.js. Fortunately sending emails in express/node js pretty easy with SendGrid using @sendgrid/mail npm package. For sending HTML emails we are going to use template engine called pugjs, this project was formerly known as Jade. Create package.json file and… Continue reading Send Email using SendGrid in Express.JS application

Implement role based access control, JWT, Express.js , Node.js

In this post, We gonna build an access control layer using express-jwt-permissions for express based application. ACL will keep users from accessing information not meant for them. We gonna create the express.js application to role-based access control example. let’s create a folder called aclJWTExpress

After creating, change the directory to aclJWTExpress

Now initialize… Continue reading Implement role based access control, JWT, Express.js , Node.js

API Caching with Redis and Node.js

In this post, I would like to show you, how we can use Redis to Cache APIs response to avoid multiple hits to the API. Same technique you can use to avoid multiple database calls ..etc We gonna create the express.js application to demonstrate Redis cache example. let’s create a folder called redisCahceExample

After… Continue reading API Caching with Redis and Node.js

How to Access Azure REST APIs with Node JS.

In this post, I will show you can access the Azure REST APIs. In order to access the Azure APIs, we need following details- tenant ID, client ID(application ID), client secret and subscription ID. So let’s grab all the above-mentioned details from your Azure portal. Lets login to the Azure portal by visiting https://portal.azure.com How… Continue reading How to Access Azure REST APIs with Node JS.

How to enable CORS in Express.js

In this post, you will learn about Cross-Origin Resource Sharing. Http requests are restricted by the same-origin policy, which means where scripts can be loaded from the same Origin. Specifically, the protocol, domain, and port must match. It means you can’t send the request to other origins, this restriction is there for a security reason,… Continue reading How to enable CORS in Express.js