与 rails (stack) 目录相比,MEAN (stack) Node.js app 目录是什么样的?

What does a MEAN (stack) Node.js app directory look like in comparison to a rails (stack) directory?

这是我第一次查看 Node 堆栈,自从我在 Rails 上使用 Ruby 学习 Web 开发以来,我对一些基本的东西有点困惑。我明白 rails 目录是什么样子的。

demo/
..../app
......../assets *Javascript, CSS, images, etc*
......../controller *Connect the model with the view*
......../helpers - *model & view assistance code*
......../models - *Database Structure*
......../views - *HTML CSS*
............../layouts *overall application view structure *
..../components
..../config *Server related stuff I only touch when pushing to production*
..../db *schema for database, db relationships defined by the model3*
..../doc
..../lib *Rake tasks, or custom tasks to populate the database*
..../log
..../public *Things I never touch/site map, custom error pages/SEO Stuff*
..../script *Things I never touch*
..../test *Things I never touch*
..../tmp *Things I never touch*
..../vendor *Things I never touch*
README
Rakefile

相比之下,MEAN 目录结构是什么样的?

它看起来像你想要的那样。它更像是一个临时堆栈,而不是像 rails 这样的完整框架。 E 代表 express,它是一个流行的 Node 框架。以下是常用的 Express 布局示例:

project/
  controllers/
    comments.js
    index.js
    users.js
  helpers/
    dates.js
  middlewares/
    auth.js
    users.js
  models/
    comment.js
    user.js
  public/
    libs/
    css/
    img/
  views/
    comments/
      comment.jade
    users/
    index.jade
  tests/
    controllers/
    models/
      comment.js
    middlewares/
    integration/
    ui/
  .gitignore
  app.js
  package.json