【问题标题】:Yeoman built angular app not deploying bootstrap fonts to herokuYeoman 构建的 Angular 应用程序未将引导字体部署到 Heroku
【发布时间】:2014-11-05 20:03:31
【问题描述】:

预先,我已经解决了这个错误。这仅供遇到的其他人参考。

我已使用本指南将 Yeoman 构建的应用程序部署到 heroku: http://www.sitepoint.com/deploying-yeomanangular-app-heroku/

除了需要删除线之外,该指南几乎完美无缺:

app.use(express.logger('dev'));

部署后,使用引导程序打包的字形图标将返回 404。经过大量挖掘后,我意识到:

dist/bower_components

由于我的 .gitignore 中的这一行,文件夹没有被添加到 git 存储库:

// .gitignore file //
node_modules
.tmp
.sass-cache
bower_components // This line!

删除意味着将我的整个 bower_components 文件夹提交到 git 存储库,我认为这没有必要。相反,我在 .gitignore 中添加了以下内容:

// .gitignore file //

node_modules
.tmp
.sass-cache
bower_components
!dist/bower_components

现在 dist/bower_components 已添加到存储库中,并将按预期部署到 Heroku。

【问题讨论】:

    标签: node.js angularjs twitter-bootstrap heroku yeoman


    【解决方案1】:

    不错的帖子,埃里克。当我试图让我的 angualr yeoman 项目在 heroku 上运行时,我也遇到了这些问题。我要补充一点,如果你想运行类似 logger 的东西,它现在被称为 morgan。因此,您仍然需要将代码中的记录器行替换为:

     var morgan = require('morgan');
     app.use(morgan('dev'));
    

    如果您愿意,这将使您能够在应用程序上使用日志记录模块。这是一个真正的痛苦,需要一段时间才能弄清楚。干杯!

    【讨论】:

      猜你喜欢
      • 2014-11-21
      • 1970-01-01
      • 2020-03-03
      • 2016-09-23
      • 2017-01-31
      • 2018-05-31
      • 2014-10-19
      • 2019-07-13
      • 1970-01-01
      相关资源
      最近更新 更多