我已經在谷歌應用引擎上部署了angularjs應用,但是存在一些與js,css,bower組件和組件目錄有關的問題。 javascript和css不在Google應用引擎上投放。這是我的app目錄結構。靜態資產無法在谷歌應用引擎上工作
myapp
app
bower_components
angular-bootstrap
..........etc
components
version.js
css
app.css
js
app.js
controllers.js
services.js
filters.js
directives.js
index.html
app.yaml
這裏是我的app.yaml文件內容:
application: myappid
version: 1
runtime: python27
threadsafe: true
api_version: 1
handlers:
url: css
static_dir: app/css
mime_type: text/css
url: js
static_dir: app/js
mime_type: text/javascript
url: /components
static_files: components
upload: components
mime_type: text/javascript
url: /bower_components
static_files: /bower_components
upload: /bower_components
mime_type: text/javascript
url: (.*)/.*
static_files: app/index.html
upload: app
url: (.*)
static_files: app
upload: app
我得到在控制檯上這些錯誤:
INFO 2015-04-23 10:02:33,782 module.py:788] default: "GET /app/ HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,846 module.py:788] default: "GET /app/bower_components/html5-boilerplate/css/normalize.css HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,847 module.py:788] default: "GET /app/bower_components/html5-boilerplate/css/main.css HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,854 module.py:788] default: "GET /app/bower_components/angular-ui-grid/ui-grid.min.css HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,854 module.py:788] default: "GET /app/css/app.css HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,854 module.py:788] default: "GET /app/bower_components/bootstrap/dist/css/bootstrap.css HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,854 module.py:788] default: "GET /app/bower_components/angular-ui-select/dist/select.min.css HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,856 module.py:788] default: "GET /app/bower_components/select2/select2.css HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,858 module.py:788] default: "GET /app/bower_components/selectize/dist/css/selectize.default.css HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,862 module.py:788] default: "GET /app/bower_components/angular/angular.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,863 module.py:788] default: "GET /app/bower_components/angular-resource/angular-resource.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,864 module.py:788] default: "GET /app/bower_components/angular-route/angular-route.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,864 module.py:788] default: "GET /app/bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,865 module.py:788] default: "GET /app/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,868 module.py:788] default: "GET /app/bower_components/angular-ui-grid/ui-grid.min.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,869 module.py:788] default: "GET /app/bower_components/angular-ui-select/dist/select.min.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,870 module.py:788] default: "GET /app/bower_components/angular-sanitize/angular-sanitize.min.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,870 module.py:788] default: "GET /app/bower_components/selectize/dist/js/selectize.min.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,871 module.py:788] default: "GET /app/bower_components/angular-ui-router/release/angular-ui-router.min.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,874 module.py:788] default: "GET /app/bower_components/underscore/underscore.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,877 module.py:788] default: "GET /app/js/controllers.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,877 module.py:788] default: "GET /app/bower_components/angular-underscore/angular-underscore.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,877 module.py:788] default: "GET /app/js/app.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,881 module.py:788] default: "GET /app/components/version/version.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,884 module.py:788] default: "GET /app/components/version/version-directive.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,885 module.py:788] default: "GET /app/js/services.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,885 module.py:788] default: "GET /app/components/version/interpolate-filter.js HTTP/1.1" 304 -
INFO 2015-04-23 10:02:33,885 module.py:788] default: "GET /app/js/filters.js HTTP/1.1" 304 -
誰能解釋一下什麼是錯的?
我已經清除緩存並再次檢查,當我去瀏覽器調試網絡,並檢查了CSS和JS它不存在了。 – mirfan899
@ mirfan899那裏不再有什麼? –
css和js文件有狀態304,但是當我通過url訪問它時,它顯示了每個css和js文件的index.html。 – mirfan899