Category: javascript

  • Node.JS Vs Go? Which is Better?

    It is imperative to choose the right stack of technologies to build a high-quality application. Especially when it comes to choosing an apt backend development technology for your application/software product. The two most popular choices for building the backend of modern-day applications are Node.Js and Go. If you intend to build a high-performance application, you […]

  • Google Custom Search with NodeJS

    Goo Google provides a custom search API by which you can use the power of google search engine in your own application. The base URL for the REST version of custom search API is: https://www.googleapis.com/customsearch/v1 Before moving on to integration part, we need two things. API KEY Search Engine ID The API KEY can be […]

  • Bing Search API with NodeJS

    Bing provides a search API by which you can use the power of bing search in your own application. The base URL for the search API is: https://api.cognitive.microsoft.com/bing/v7.0/search The code to integrate the API using Express and Node JS is: The API Subscription Key can be created at the website: https://azure.microsoft.com/en-in/services/cognitive-services/bing-web-search-api/ If you want more […]

  • Meteor Methods vs REST API

    Many of you must have used MeteorJS Methods and have often mistook them for an analogue of REST API. Although Meteor Methods are similar to POST API request but they are quite different. The main difference between the two is that Meteor Methods are DDP (Distributed Data Protocol) messages and are based on RPC (Remote Procedure […]

  • JavaScript – Stringify Object to formatted JSON

    There are numerous cases where we need to convert our objects to JSON using JSON.stringify and there are also several cases where we need to have the output JSON to be formatted for easy readability. For the above-mentioned purpose JSON.stringify(…) function has support to format the output if required. It takes special arguments for this purpose. JSON.stringify Signature [cc lang=”javascript”] JSON.stringify(value[, replacer[, space]]) [/cc] Here […]

  • Why Meteor’s account-ui-bootstrap-3 {{loginButtons}} not displaying

    Sometimes this happens when you include both accounts-ui and accounts-ui-bootstrap-3 packages in your App. The standard package accounts-ui classes tends to overrides the CSS classes of bootstrap-3 styled “accounts-ui”. Just remove the standard package from your App by typing the following command in terminal: [cc lang=”javascript”] meteor remove accounts-ui [/cc] And you will see you {{loginButtons}} get appear […]

  • Hapijs – views

    There are two ways for rendering a view by using reply.view()interface, or by using view handler. – reply.view() [cc lang=”javascript”]server.route({ method: ‘GET’, path: ‘/’, handler: function (request, reply) { reply.view(‘index’); } });[/cc]   if you want to pass context to reply.view(), pass an object as the second parameter, for example: [cc lang=”javascript”]server.route({ method: ‘GET’, path: […]

  • Build Your First HTTP Server in NodeJS

    In this tutorial, we will be talking about how we can set up a simple NodeJS HTTP server with a beginner’s perspective. NodeJS is a fantastic candidate for creating web servers which are light weight and can handle a very good volume of requests. NodeJS is shipped with several core modules out of which we […]

  • Hapijs – Built in methods

    Hapi has some built in logging methods, as well as some limited capability for viewing these logs. There are two nearly identical logging methods, – server.log, – request.log. > They both accept up to three parameters. They are, in order, tags, data, and timestamp. – tags is a string or array of strings used to […]

  • Hapijs – Adding Routes in HapiJs

    In this blog, we will learn how to Adding routes in Hapi. Steps. – Define the path. – Define the method. – Define the handler. let’s see an example of it [cc lang=”javascript”] var Hapi = require(‘hapi’); var server = new Hapi.Server(); server.connection({ port: 3000 }); server.route({ method: ‘GET’, // define the method path: ‘/’, […]

  • Hapijs – Plugins

    hapi has dozens of plugin system. like , Authentication, Documentation, Localization/Internationalization, Logging/Metrics, Messaging, Security, Session, Templating, Utility, Validation…. – you can write your own plugin. – plugins are objects with a register function, and has a signature function (server, options, next). – register function has an attributes object. – this object provides some additional information […]

  • Node.js tutorial – How to use Request Module

    In any application framework, one basic need is to be able to make REST calls over HTTP/HTTPS as they are widely used and a very handful in case of API interactions, web scraping, etc. We can use the NodeJS core modules or http https to perform these calls but that is a bit cumbersome process and […]

  • The Session in Meteor

    Meteor is a reactive framework. What this means is that as data changes, things in your application change without you having to explicitly do anything. The current state of the user’s application is completely contained in the URL that they are looking at (and the database). But in many cases, you’ll need to store some […]

  • Setup an environment for working with react.

    In order to setup an environment for working with react we can use the create react package. To install create react package. npm i create-react-app -g After installing crate-react-app package, genrate simple react app by using following command. create-react-app <dir> example:-create-react-app first-react-app This might take a couple minutes. cd first-react-app Start the app:- npm start […]

  • How to use paytm in your website to add money to your wallet using javascript.

    Paytm wallets are used in almost all the websites we encounter these days. Also it is one of the best wallet used for handling digital transactions. Although Paytm has provided us with the direct API for checking balance and making payments if we have sufficient balance in our wallet. But what if we do not […]