Create a RESTful API using NodeJS and MySQL Database
We have already discussed how to create RESTful APIs using PHP and Java in my previous tutorials. Let’s see how to create RESTful API usig Node for processing HTTP requests. With this API created, you can just use it with any application that submits HTTP request. It is the best way to work especially if you are building any mobile application.
You have to install NodeJs and MySQL softwares, create following tables or download sql file from my Git repository and import.
User table contains all the users registration details.
`uid` int(11) AUTO_INCREMENT,
`username` varchar(50),
`password` varchar(200),
`email` varchar(200),
PRIMARY KEY (`uid`)
);
This table contains all of the user messages.
`mid` int(11) AUTO_INCREMENT,
`message` text,
`uid_fk` int(11),
PRIMARY KEY (`mid`)
);
Recent Comments