Throughout our examples, some required npm packages need to be installed, some of them can be installed by npm – build-in package management tool, and the remaining are bundled with Node.js . Please find the below packages and their details: Package Express NPM Install npm install express Functions Provide the coding framework Usage Create the
Before working on the examples, let’s setup the environment first: Install MySQL (using 5.7 for our example), you can download from http://dev.mysql.com/downloads/mysql/ Download and install Node.js version 4.X from https://nodejs.org/en/ Run “cmd”, and using it to install necessary modules Install Express framework by “npm install express” Install ejs template engine by “npm install ejs” Install logger Morgan by “npm install morgan”
Why use Node.js? You may hear people saying that node.js is not good, poor performance, and not for enterprise application. Before answering this question, we better to have a look to the below pros and cons. Then, we can conclude what kind of application is good to build with node.js, and what is not.