Node.js A simple example in the Development Guide (MySQL edition) _javascript tips

Source: Internet
Author: User

Anyway
1. Why would you want to write this article?
A: Because in the process of reading this book, the usage is different from the book since the Nodejs version is upgraded.
Also because Nodejs this thing is really good, is worth studying.
2. What is the difference between my example and the example in the book?
A: Nodejs version is different, I use the latest version of the example. The database is different, the book uses is the MONGDB, I use is the MySQL.


Models-> is used to put the model object, the book example has post topic and user two objects
Node_modules->nodejs modules, such as MySQL, Express, Connect-flash, Ejs, jade, etc.
Public-> is used to store public resources, such as pictures, JavaScript, CSS, etc.
Routes-> store routing files to handle various get, POST requests (which need to be configured in App.js)
Utils-> Tool class, where the uuid.js is used to generate IDs
Views-> Store page file, here is the same as the book is Ejs template engine
App.js-> Project Entrance
Database.js->mysql Database base class
package.json-> system configuration files (including version information for some modules)
Setting.js-> Database configuration file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.