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. angular.js - angular里的ui-view里,獲取當前頁面的狀態參數用$state.params,在vue里類似的語法是什么呢?2. 前端 - CSS3問題:請問-webkit-background-clip屬性,需要寫在background屬性后面嗎?3. javascript - 按鈕鏈接到另一個網址 怎么通過百度統計計算按鈕的點擊數量4. html5 - h5+中webview的show方法有延遲5. 微信開放平臺 - ios APP能不能打開微信然后通過微信跳轉到指定的URL?6. 淺談vue生命周期共有幾個階段?分別是什么?7. node.js - nodejs+express+vue8. Mysql啟動發生系統錯誤10679. nginx - vue-cli生成的項目打包發到服務器后怎么代理api?10. 大家好,我想請問一下怎么做搜索欄能夠搜索到自己網站的內容。
