Home > Web Front-end > JS Tutorial > Simple examples in Node.js development guide (mysql version)_javascript skills

Simple examples in Node.js development guide (mysql version)_javascript skills

WBOY
Release: 2016-05-16 17:22:24
Original
1491 people have browsed it

Back to business:
1. Why did you want to write this article?
Answer: In the process of reading this book, the usage is different from the book after the nodejs version is upgraded.
In addition, nodejs is really good and worth learning.
2. What is the difference between my example and the example in the book?
Answer: The nodejs versions are different. The latest version is used in my example. The databases are different. The book uses mongdb, and I use mysql.


models-> Used to place model objects. Examples in the book include post topic and user objects.
node_modules->nodejs modules, such as mysql, express, connect-flash, ejs, jade, etc.
public-> are used to store public resources, such as pictures, javascript, css, etc.
routes-> are used to store routing files and are used to handle various get and post requests (need to be configured in app.js )
utils->Tool class, uuid.js here is used to generate id
views-> to store page files, the same ejs template engine used here as in the book
app.js-> ;Project entrance
database.js->mysql database base class
package.json->System configuration file (including version information of some modules)
setting.js->Database configuration file

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template