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. javascript - 微信小程序中设置头像 里面的图片路径是怎么解决的 我把接口生成的路径存到数据库中 2次访问时就显示不出来了2. javascript - 我写的href跳转地址不是百度,为什么在有的机型上跳转到百度了,有的机型跳转正确3. angular.js - react的redux和vue的vuex,angular呢4. angular.js - vue/react 渲染内容抖动5. 新手学习vue和node.js的困惑6. python - 如何用openpyxl在现有的excel文件中写入数据7. objective-c - IOS 如何实现网易云音乐选择头像的ImagePicker8. 我设置的背景怎么显示不出来9. android - 有没有人做过类似支付宝那种汇率换算功能的?10. 在使用Vim编辑Python这类的脚本时,如何在下方嵌入一个小小的shell,以方便观察输出结果?
