node.js - Heroku本地測試與線上測試效果不同
問題描述
用express框架搭建博客,想要支持代碼高亮功能,于是引入highlight.js模塊,本地測試的時候代碼可以正常渲染,包括使用heroku local也可以,但是push到服務(wù)器上不能正常顯示。引入的highlight代碼如下:
<link 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:控制臺有什么報錯么
相關(guān)文章:
1. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””2. MySQL數(shù)據(jù)庫中文亂碼的原因3. macos - mac下docker如何設(shè)置代理4. docker不顯示端口映射呢?5. docker - 各位電腦上有多少個容器啊?容器一多,自己都搞混了,咋辦呢?6. angular.js - angularjs的自定義過濾器如何給文字加顏色?7. docker gitlab 如何git clone?8. android studio總是在processes running好久9. java - 請問在main方法中寫成對象名.屬性()并賦值,與直接參參數(shù)賦值輸錯誤是什么原因?10. css - C#與java開發(fā)Windows程序哪個好?
