Sign in

learning to be a javaScripter and an eGOist
Image for post
Image for post
Photo by Alex Motoc on Unsplash

Recently we had to switch from Netlify to Firebase for React hosting. Going from Netlify to Firebase, not gonna lie, is a little painful process. Netlify got a huge benefit of time reduction and a simplified hosting process. But that does not mean Firebase is hard, it’s just that I was using Netlify for a long time. And we know the nuances and etc.

The main requirement for us is that we are using a tag-based release flow. We have only one main branch (not separate branches for staging and prod, dev) from where we tag releases for staging and…

Image for post
Image for post
Photo by Luís Perdigão on Unsplash

In this story, we are going to create a background cloud function for pubsub google using typescript. We will be using cloud build for continuous deployment.

This will be a push-based background function that will be automatically executed once there is a message available to consume. However, you can easily modify the approach best suited to your needs. Since this is a push-based function we will not be using any request/response, since we receive only the payload. The approach is similar to other types of cloud functions, only the code logic will change everything other remains the same.

So let’s…

Image for post
Image for post
Photo by Christiann Koepke on Unsplash

Caching is the process of storing data that are accessed frequently and changed less often. This will help in the delivery of data faster, thus improve your application performance.

Node-cache is one of the popular NPM packages for caching your data. Here we are implementing the caching as a part of the application code. ie As an in-application cache. Node-cache is actively developed and supported. You can also be a contributor by going in to the repo participating in the issues. It has 2.9M/month active downloads and 700k weekly download stats in NPM.

Node-cache supports events. Events are emitted for…

Image for post
Image for post

Middlewares are one of the important concepts in the express. Express allows you to write functionalities that can be reused while creating routes for your express application. Middlewares are functions that have access to request, response objects. It may optionally contain the next function and an error object.

Creating application-level middleware

An express middleware is a function that has access to request, response object. So creating an express middleware is as simple as that defining/exporting a function with these two params,

module.exports = (req,res)=>{console.log(HEADERS: `${req.headers}`)

Now we created a simple middleware function. So as you can see…

Image for post
Image for post
Photo by Ethan McArthur on Unsplash

This is yet another tutorial on getting started with Expressjs. Express js is one of the popular frameworks for creating API-servers/web application in Nodejs. We can quickly prototype a new application using express. Many popular API services embed express under the hood eg: loopback. Most of them provide support for Express.

Of course the simplicity. You can quickly prototype and experiment with your application in a couple of minutes. You can easily create routes, deliver static assets, debug and support for templating languages are some of its features. The most important feature is the middleware. …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store