admin管理员组文章数量:1290945
There is already similar question at Folder structure for a Node.js project but answer to that post seems to be purely for nodejs, does not consider the angularjs.
I dont need view folder mentioned in above post as I will be using view inside app folder for angularjs.
Can anyone please help me with better folder structure...like where to put route logic, where to business logic. folder should be segregated by functionality or feature...etc?
There is already similar question at Folder structure for a Node.js project but answer to that post seems to be purely for nodejs, does not consider the angularjs.
I dont need view folder mentioned in above post as I will be using view inside app folder for angularjs.
Can anyone please help me with better folder structure...like where to put route logic, where to business logic. folder should be segregated by functionality or feature...etc?
Share Improve this question edited May 23, 2017 at 12:33 CommunityBot 11 silver badge asked Jan 9, 2016 at 6:13 VikashVikash 4937 silver badges15 bronze badges1 Answer
Reset to default 9If you are building application using both Node JS and Angular JS, then your folder structure should be like below.
/App - Folder that Contains your angular js applications
/AppName - Folder containing files related to specific application.
/contorllers - Folder containing controllers related to specific app.
- abcController.js - JS file containing logic for abcController.
- /directives - Folder containing directives related to specific app.
- /animations - Folder containing animations related to specific app
. . . /services - Folder containing services related to specific app.
app.js - JS file containing your routes handled by this app, application initialization and configs.
/views - Folder containing html view files.
/monDirectives - Folder containing mon directives.
- OverlayDirective.js - JS containing logic for overlay directive.
/monViews - Folder containing mon html view files.
coreApp.js - JS file containing your core app initialization, configurations and routes that are mon for all apps (for example dashboard, aboutus, contactus etc.)
/server - Folder containing your node js server.
/libs - Folder containing your custom libraries.
/models - Folder containing schemas for your database models (like in mongo db -define different schemas for different document).
/routes - Folder containing routes handled by node js server.
/plugins - Folder containing your custom plugins (like database plugin, processRequest plugin etc.)
/spec - Folder containing specifications.
/tests - Folder containing test applications
server.js - JS file containing your server logic.
package.json - Package.json file.
本文标签: javascriptFolder structure for angularjs and nodejs appStack Overflow
版权声明:本文标题:javascript - Folder structure for angular.js and node.js app - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741513224a2382728.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论