Nodejs Practice-code Organization

Source: Internet
Author: User
Tags compact

Nodejs Practice-code Organization
[Email protected]
Contents 1.? Code Organization 1.?Code Organization

Updated version

NPM Install -G N

N Latest project file organization

    • Mvc
    • Separation of front and back code
    • Clear Organizational Project code

Horizontal folder structure:

    • Organize a group of C by file role

Vertical folder structure

    • Organize by file function

Project initialization:

    • Specification of the Package.json file
    • Bower.json

Modularity: using a file using a function Module.exports exports

Back-end Project practice NPM init Step into parameters, create Package.json entry point: (index.js)/BIN/WWW now recommended

App Bin config directory ntpdate pool.ntp.org update server time

NPM Install body-parse –save –registry=http:// registry.npm.taobao.org

Body-parse parsing Post

–Save Write Package.json


Source: https://www.madoko.net/preview/preview.html

From for notes (Wiz)

Nodejs Practice-code Organization

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.