Skip to main content

Posts

Latest

Automate Build & Deploy React production build with gitlab-ci to Linux base server (AWS)

Recent posts

Headless Browsing and UI testing Automation : A nightmare

Do you ever need to use the web using your code instead of a web browser? That's what we call Headless Browsing. The prime application for headless browsing is Automate the UI testing flow. Some other applications I can think of is keeping track of some rates of particular items from some sites on daily basis, visiting some website for views (If you are using google products you might not want to use this as google have set strict policy for this), parsing data from other sites. So, the main purpose of headless browser  Test automation in modern web applications. Taking screenshots of web pages. Running automated tests for JavaScript libraries. Scraping web sites for data. Automating interaction of web pages. How you can achieve this with node.js? Nightmare , don't get scared it's just a name of a node package. So, you to just need to install nightmare in your project like this, npm install nightmare Let's just write a script for logging in

Custom application logic for Loopback models

This post is the continuation of the previous one .  What if you want to customize your REST API or add different methods for it? When building an application, you’ll generally need to implement custom logic to process data and perform other operations before responding to client requests. In Loopback there are 3 ways to do this: Adding logic to models Defining boot scripts Defining middleware For this post I'm explaining about the first one, Adding logic to models. There are 3 types to add custom application logic to model. Remote Method Remote Hook Operation Hook Remote Method : A remote-method is nothing but nodejs function mapped to REST endpoints. You can create remote-method by cli or typing by yourself ( click here to know how ).  In the previous post, I used memory db. For this one, I'm going to use MongoDB as datasource. You need to install loopback-connector-mongodb to connect to MongoDB. npm install loopback-connector-mongodb --save

Loopback by Strongloop : Getting started

Loopback is developed by Strongloop and maintained by IBM.  The LoopBack framework is a set of Node.js modules that you can use independently or together to quickly build REST APIs. Heart of Loopback is its models. The application interacts to data-source through models. The following diagram illustrates, How loopback works : Benefits of using Loopback over Express Loopback has a steep learning curve, on other side Express have a very little learning curve.  Loopback has built-in Database integration, whilst you need npm package in Express. Loopback has built-in models and authentication, API explorer, built-in ORM/ODM with the juggle and various driver and ACL. On the other side, Express needs separate npm package for all this. Node.Js is widely used for quickly wrapping up projects with REST APIs. You have to choose the framework that best suits you and the project. Installation : Prerequisite : Node.Js After making sure that you have Node.js installed

Points to keep in mind while developing Email Templates

I have come to know that in frontend development Email Template designing is a kind of headache for those who don't know how to code the HTML perfectly. There are many things to keep in mind if you're designing an Email template, from the basic difference between a static webpage and an email template or how will email service providers render your template. So, here are the points you must keep in mind: 1. Use Table instead of div Most of the email clients are not supporting the div structure on top of the body, the render engine mishandles your style. Instead of that, you must use the table tag, which should be the first element in the body.  So, dived your classic div structured into rows and columns for the email. For the best-case scenario, use one column UI. 2. Use inline-css Outlook, Gmail and Yahoo remove your HTML & head tag to resolve the conflict between their own tags. So, if you are using external css or internal css then it will be excluded, to over

FizzBuzz Problem

Hello guys, today I'm discussing about a well-known interview question, asked for logic measurement of a backend developer in many IT company. fun fact : This is discussed in Stackoverflow 's Annual Survey 2019. Fizz Buzz Problem  Problem statement:  Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz” PS: I'm using javascript to solve this problem Solution: This is really simple, but tricky question if you don't pay attention. Happy Codding.

Webpages with Github hosting

Website for you and your projects. Hosted directly from your GitHub repository . Just edit, push, and your changes are live. GitHub now can host your static projects to their servers, and that's for free. You just have to enable the GitHub pages for your repositories. You can forward GitHub's default URL to your custom domain/sub-domain. Let's see how we can do that. Login to your GitHub account. create a new repository with name "(your GitHub username) .github.io". This is your base GitHub page. add a sample index.html file to master branch and after commit, open a new tab on your browser and type:  (your GitHub username) .github.io  Bingo!! you just hosted your first page on GitHub. (If it does not reflect the changes wait for some time, GitHub might be taking some time to publish it) GitHub gives the option to use it's prebuilt theme to the pages. If you don't want to create a custom static site then go to settings of the repository. Scroll do