node.js - 带有 Angular2 项目的 ExpressJs 的文件结构

标签 node.js express angular

典型的 ExpressJsAngular2 文件结构是什么样的。 目前我有这个:

 Project
 |
 |--bin
 |--node_modules
 |--public
     |--images
     |--javascripts
     |--stylesheets
 |--routes
 |--views
 |--app.js
 |--package.json

在我的公共(public)文件夹中,我有 index.puglayout.pug。这是 expressJs 提供的默认结构。现在我想添加 Angular2,我将把我的 Angular 文件放在哪里?我可以将 boostrap 与 jade 一起使用吗?让我补充一下,这是 Node 的新手。谢谢

最佳答案

您正在寻找的似乎是类似于标准 MEAN 堆栈应用程序的东西(尽管您的数据库可能不是 MongoDB)。你应该使用 Angular CLI在该项目目录中自动生成一个 Angular2 项目,如下所示:

Project
|-angular2-project-directory/
    |--src/
    |--package.json
    |--README.md
    |--...(Other Angular CLI generated files)
|--routes/
|--views/
|--app.js
|--package.json

希望这对您有所帮助!

关于node.js - 带有 Angular2 项目的 ExpressJs 的文件结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38611469/

相关文章:

node.js - 在 Node 中使用 mongoosejs 更新多条记录

node.js - 在 node.js 中使用 Promise 从 s3 bucket 下载图像

node.js - 在 Gulp/Node 中将 jekyll 作为子进程运行

node.js - Node.js + Express 中的 request.cookies ['name' ] 和 request.cookies.name 有什么区别

mysql - 在 Sequelize 中未定义 findOne 属性

javascript - Express GraphQL 必须提供查询字符串。

javascript - 在 express 中捕获来自 mongoose 查询的错误

angular - 将 @fortawesome/fontawesome 包含到 angular-cli 项目中

Angular 2 - 使用 @Input 传递 url

Angular 和 AngularFire 5 从文档中检索数据