node.js - Heroku本地测试与线上测试效果不同
问题描述
用express框架搭建博客,想要支持代码高亮功能,于是引入highlight.js模块,本地测试的时候代码可以正常渲染,包括使用heroku local也可以,但是push到服务器上不能正常显示。引入的highlight代码如下:
<link href='http://cdn.bootcss.com/highlight.js/8.0/styles/monokai_sublime.min.css' rel='stylesheet'> <script src='http://cdn.bootcss.com/highlight.js/8.0/highlight.min.js'></script> <script>hljs.initHighlightingOnLoad();</script>
Profile 文件:
web: npm run heroku
package.json文件:
'scripts': { 'test': 'node --harmony ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha', 'start': 'NODE_ENV=production pm2 start index.js --node-args=’--harmony’ --name ’myblog’', 'heroku': 'NODE_ENV=production node --harmony index' },
本地显示效果:
线上显示效果:
问题解答
回答1:控制台有什么报错么
相关文章:
1. python - 基于scrapy-redis的分布式爬虫运行的时候不能正常运行 遇到的问题如下截图所示2. android - NavigationView 的侧滑菜单中如何保存新增项(通过程序添加)3. android - 新建项目卡在Gradle:Resolvedependencies’:app:_debugCompile’4. angular.js - 焦虑!angular的ng-options的问题5. javascript - 关于在angularjs的select中遇到的问题!!6. Android Studio 中程序添加不上Xutils 3.0 jar包7. css3 - 我的css用less写的,eclipse的jsp文件要修改css很麻烦,怎么解决?8. angular.js - Angular1使用bootstrap轮播条carousel不能自动轮播9. atom编译器 如何格式化前端代码文件?10. android - 使用listview加载不同item,数据填充错误。