私は、helokuにnode.js + Express + express-handlebarsアプリケーションをデプロイしています。アプリケーションを実行すると、コンソールにjqueryファイルが見つかりませんでした(404)というエラーが表示されます。この結果、カスケード効果が生じ、Bootstrap、Datatablesなどの依存ライブラリが生成されません。jQueryファイルがnode.jsに見つかりません+ HerokuにデプロイされたExpressアプリケーション
次は私のpackage.jsonファイル
{
"name": "test-node",
"version": "0.0.1",
"description": "Test node",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/username/repo.git"
},
"author": "Neeraj Jadhav",
"license": "ISC",
"bugs": {
"url": "https://github.com/username/repo/issues"
},
"homepage": "https://github.com/username/repo",
"dependencies": {
"bcrypt-nodejs": "0.0.3",
"body-parser": "^1.15.0",
"cookie-parser": "^1.4.1",
"express": "^4.13.4",
"express-handlebars": "^3.0.0",
"express-session": "^1.13.0",
"method-override": "^2.3.5",
"moment": "^2.12.0",
"mysql": "^2.10.2",
"passport": "^0.3.2",
"passport-local": "^1.0.0",
"sendgrid": "^2.0.0",
"serve-favicon": "^2.3.0",
"shortid": "^2.2.4"
},
"engines": {
"node": "0.10.28",
"npm": "1.4.9"
}
}
次のとおりであるが、私のノードのjsプロジェクトフォルダ構造のスクリーンショットです。
私が誰も上記の静的ファイルを参照するコード行を移動しjqueryの-1.12.1.min.js私のapp.jsで
を見つけることができませんそれ以外は、それでも動作しません。 jquery Herokuのリンクを新しいタブで開き、jsの前にpublicを追加すると、https://admin-violet.herokuapp.com/public/js/jQuery-1.12.1.min.jsのように同じエラーが表示されます。
jqueryのファイルを見つけることができない理由は上の任意のアイデア?私はHerokuにノードjsプロジェクトを展開しましたが、この問題に直面しませんでした。
ヘルプを評価してください。