i
Creating a Web Server
Handling Get Requests
Handling Post Requests
Event Handling
Event Loop
Routing
Streams
Debugging a Node application
Framework in Node.js
Express.js
Templating Engine
Invoking a REST Service
Pre-requisites for Node.js
Introduction to Node.js
What to use Node.js for?
Node.js - Environment Setup
REPL Terminal
MySQL is a relational database and node has several modules available to connect to it.
Mysql module is built-in module available to connect with MySQL database. To use this module, lets download it from npm
Using
>npm I MySQL
Further, Let us see the same with an example.
mySql-demo.js
In above example, we have created two functions for authenticating user and adding user to Book
This application is similar to preceding example where we have used MongoDB.
In AuthenticateUser method, we will take username and password from user and authenticate the user; if the user is authenticated fine, then call the callback function as in the example.
For AddUSer, we can add a user to Users table in the books database and if the book added successfully then the callback function will get executed.
Don't miss out!