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. windows误人子弟啊2. php传对应的id值为什么传不了啊有木有大神会的看我下方截图3. python - linux 下用wsgifunc 运行web.py该如何修改代码4. python - oslo_config5. 关于mysql联合查询一对多的显示结果问题6. 实现bing搜索工具urlAPI提交7. 冒昧问一下,我这php代码哪里出错了???8. mysql优化 - MySQL如何为配置表建立索引?9. MySQL主键冲突时的更新操作和替换操作在功能上有什么差别(如图)10. 数据库 - Mysql的存储过程真的是个坑!求助下面的存储过程哪里错啦,实在是找不到哪里的问题了。
