node.js - Heroku本地測試與線上測試效果不同
問題描述
用express框架搭建博客,想要支持代碼高亮功能,于是引入highlight.js模塊,本地測試的時候代碼可以正常渲染,包括使用heroku local也可以,但是push到服務器上不能正常顯示。引入的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:控制臺有什么報錯么
相關文章:
1. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””2. docker-compose中volumes的問題3. boot2docker無法啟動4. nignx - docker內nginx 80端口被占用5. docker安裝后出現Cannot connect to the Docker daemon.6. dockerfile - 為什么docker容器啟動不了?7. java - SSH框架中寫分頁時service層中不能注入分頁類8. node.js - antdesign怎么集合react-redux對input控件進行初始化賦值9. 關于docker下的nginx壓力測試10. docker容器呢SSH為什么連不通呢?

網公網安備