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. PHP类中的$this2. javascript - 请教如何获取百度贴吧新增的两个加密参数3. javascript - 使用百度文本编辑器ueditor不显示样式问题4. css - html文件上传到虚拟主机后使用谷歌浏览器打开html元素的宽度变大5. python - 用__call__ 实现装饰器功能6. android - 安卓实现类似QQ刚换聊天背景的功能7. java - win10 下有什么好的输入法可以在idea下正常输入吗?8. javascript - 微信小程序 wx.downloadFile下载文件大小有限制吗9. html5 - canvas有时候会拿不到toDataURL数据10. 微信小程序
