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 - vue 父子组件传递数据2. docker不显示端口映射呢?3. javascript - 微信小程序 如何实现这种左滑动出现删除的办法?有相关api吗?4. docker images显示的镜像过多,狗眼被亮瞎了,怎么办?5. javascript - 怎么实现让 div 里面的 img 元素 中心居中, 如下示例图6. javascript - CSS图片轮播显示问题7. javascript - vue-router怎么不能实现跳转呢8. python 字符串匹配问题9. dockerfile - 我用docker build的时候出现下边问题 麻烦帮我看一下10. javascript - 自执行函数是当加载到这个js就执行函数了吗
