Friday, 14 October 2016

NodeJS Interview Questions and Answers for beginners

NodeJS Interview Questions and Answers for beginners

Question: What is NodeJS?
Node.js is a server-side platform.


Question: On which engine built on NodeJS??
Node.js is is built on Google Chrome's JavaScript Engine(V8).


Question: What type of application can be built using NodeJS?
  1. server-side application
  2. networking applications



Question: On which OS it can be run?
  1. OS X (Mac)
  2. Microsoft Windows
  3. Linux



Question: In what type of application we can use NodeJS?
  1. I/O bound Applications
  2. Data Streaming Applications
  3. Data Intensive Real-time Applications (DIRT)
  4. JSON APIs based Applications
  5. Single Page Applications



Question: What is REPL?
REPL is environment to test/debug the code of nodeJS.
Full form of REPL is Read Eval Print Loop.


Question: What is package.json?
package.json define the properties of a package like name, description, version, author, contributors and dependencies.


Question: Where does exist package.json in package?
It exist in root folder of every package.


Question: How to create an API in nodeJS?
var mysql = require("mysql");
var app = require('express')();
var http = require('http').Server(app);
var con = mysql.createConnection('mysql://arun:arun@localhost/enterprisedev2');

app.get('/get/records', function(req, res) {
    con.query('SELECT id,userName,text FROM users where usertype=3', function(err, rows) {
        res.send(rows);
    });
});



Question: How to escape a string while insert into database?
var mysql = require("mysql");
mysql.escape('userdata');



Wednesday, 21 September 2016

How to add Meta Tags for Linkedin

How to add Meta Tags for Linkedin

When you share your website OR Website pages into Linkedin, Everything should looks great like title, description, image and link on title. So that sharing can attract linkedin users to your website by clicking on link.

For this You have to integrate Open Graph Tags into your websites.  same as your might have integrte for Facebook Open Graph OR Twitter card.

Adding Meta tags into website is quite simple, See below.

1) Add following attribute in HTML tag
prefix="og: http://ogp.me/ns#"

2) Add Following tags between <head> and </head>.
 
    <meta property="og:title" content="This is title" />
    <meta property="og:description" content="This is description" />
    <meta property="og:url" content="http://example.com/link" />
    <meta property="og:image" content="http://example.com/images/backImg.jpg" />
    <meta property="og:type" content="website" /> 
    

Now please update the data as per your website page.

If you want to Good picture quality inside Linkedin Post OR Want to embed video. PLease look below:
http://ogp.me/#types