Node.js Security

October 10, 2017 superadmin 0

Everyone knows how security is very important to our application. So i have put together this checklist to help you guide through the must have security checks before your application is enabled to thousands of users. Use TLS ( Transport Layer Security) If you transmits sensitive data, use Transport Layer Security (TLS) to secure the connection and the data. TLS encrypts data before it is sent from the client to the server, thus preventing some common (and easy) hacks. Disable X-Powered-By header: If you don’t want to use Helmet, then at least disable the X-Powered-By header. Attackers can use this [...]

HTTP Methods for RESTful Services with Examples (Mongoose)

October 9, 2017 superadmin 0

The primary or most-commonly-used HTTP verbs (or methods, as they are properly called) are POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations, respectively. POST – Create This is how we can create new items in the database. This will commonly be from an HTTP POST request, although you can do this anywhere you want var article = new Article(req.body); article.save((err, article) => { if (err) { res.status(500).send(err); } res.status(200).send(article); }); GET – Read Here the example like, how HTTP get method are typically used in a RESTful API: 1. Finds all [...]

Gmail POP3 and SMTP settings

October 4, 2017 superadmin 0

Please follow the instruction to setup gmail account for email sending(SMTP) and fetching(POP3): Email sending To send emails using Gmail server enter these details: SMTP Host: smtp.gmail.com SMTP Port: 587 SSL Protocol: OFF TLS Protocol: ON SMTP Username: (your Gmail username) SMTP Password: (your Gmail password) POP3 fetching: (make sure that “POP3 download” in your Gmail settings is set to “Enable POP for mail that arrives from now on”.) To fetch mail from Gmail server enter these details: POP3 Host: pop.gmail.com POP3 Port: 995 TLS Protocol: ON POP3 Username: (your Gmail username) POP3 Password: (your Gmail password)

Error-first callback in node.js

September 19, 2017 superadmin 0

The “error-first” callback is nothing but a standard protocol for Node callbacks. Error-first callbacks are used to pass errors and data as well. The “error-first” callback has a simple rule that the first argument for the callback function should be an error object and it has to be checked to see if something went wrong. Additional arguments are used to pass data. fs.readFile(“./test.php”, function(err, data) { if (err) { // handle the error, the return is important here // so execution stops here return console.log(err) } // use the data object console.log(data) }) As you can see in the above [...]

What is Callback hell in Node.JS

September 19, 2017 superadmin 0

Callback hell “refers to heavily nested callbacks that have become unreadable. To fix this we can break callbacks into independent functions that is referred as modularization. An Example of heavily nested code is below: query(“SELECT userId FROM userss WHERE userName=’jhon’;”, function(id){ query(“SELECT * FROM articles WHERE articleId=” + id, function(articles){ articles.each(function(article){ query(“UPDATE articles SET status = ’0′ WHERE id=” + article.id, function(error){ if(!error){ console.log(“success!!”); }else{ console.log(“error”); } }); }); }); }); To fix this, the above callbacks are broken out into independent functions which can be called with some parameters. var logError = function(error){ if(!error){ console.log(“success!!”); }else{ console.log(“error”); } }, [...]

How to install Angular 2 And Other Dependencies

September 13, 2017 superadmin 0

To start working with Angular 2, you need to do the below steps: Installation steps: 1. Npm: This is known as the node package manager that is used to work with the open source repositories. Angular JS has dependencies on other components. And npm can be used to download these dependencies and attach them to your project. The best way to install npm is to install node using the node.js installer. npm is installed as part of node. 2. Go to Node js official website and choose the installer to download, depending on the operating system. For the purpose of [...]

What is AOT Compilation in Angularjs 2

September 13, 2017 superadmin 0

AOT (Ahead of Time compilation) is used to compiles the angular components and templates to native JavaScript and HTML during the build time instead of run-time. The compiled HTML and JavaScript are deployed to the web server so that the compilation and render time can be saved by the browser. So It is the biggest advantage of AOT to improve the performance of applications. Advantages: Smaller Angular framework download size:  The Angular 2 app is already compiled so it is faster. Faster Rendering: The browser downloads a pre-compiled version of the application. So the browser loads already executable code and [...]

Advantages of angularjs 2 over angular 1

September 13, 2017 superadmin 0

The main differences and advantages on Angular2 vs. Angular 1 as following: It is entirely component based: The earlier version of Angular had a focus of Controllers but now has changed the focus to having components over controllers. Angular 1: var app = angular.module(“userApp”, []); app.controller(“userController”, function($scope) { $scope.users = [{ name: "sathish", Age:30}, { name: "ram", Age:33}]; }); Angular 2: Here the @Component annotation is used to add the metadata to the class. import { Component } from ‘angular2/core’; @Component({ selector: ‘usersdata’, template: ‘<h3>{{users.name}}</h3gt;’ }) export class UsersComponent { users = [{ name: “sathish”, Age:30}, { name: “ram”, Age:33 [...]

What is angular js 2

September 13, 2017 superadmin 0

Angular 2 is an open source JavaScript framework to build client applications in HTML and JavaScript. Angular 2 is so simpler, faster, modular and instrumented design. Angular 2 is a most popular framework for developing mobile applications as well as desktop applications.The “Angular 2″ is using “Traceur” compiler and it takes “ES6″ and compiles it down (ES5) to regular JavaScript that runs in your browsers. It supports following modern browsers are: 1. Chrome 2. Firefox 3. Opera 4. Safari 5. IE Version10, 11 and so on…

How To Install FFmpeg On Ubuntu 14.04

March 31, 2017 superadmin 0

Hello Linux lovers. In this article I will show you how to install FFmpeg on Ubuntu 14.04. FFMPEG that enables the users to easily ncode, transcode, mux, demux, stream, filter and play audio and video content. There are two methods that we can install the FFMPEG METHOD 1: $ sudo add-apt-repository ppa:mc3man/trusty-me $ sudo apt-get update $ sudo apt-get install ffmpeg METHOD 2: $ sudo wget https://ffmpeg.org/releases/ffmpeg-2.3.6.tar.gz $ sudo tar -zxvf ffmpeg-2.3.6.tar.gz $ cd ffmpeg-2.3.6 $ sudo ./configure –enable-version3 –enable-postproc –enable-libvorbis –enable-libvpx $ sudo make $ sudo checkinstall –pkgname=ffmpeg –pkgversion=”5:2.3.6″ –backup=no –deldoc=yes –default And also i have given some audio [...]

1 2 3 4