Nodejs Practice-code Organization
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