英文:
Google app engine + Go + serve static files + what is wrong with the config
问题
我有一个app.yaml文件,内容如下:
application: test
version: 1
runtime: go
api_version: go1
handlers:
- url: /
static_files: client/index.html
upload: client/index.html
- url: /index\.html
static_files: client/index.html
upload: client/index.html
- url: /(.*\.(css|gif|png|jpg|ico|js|html))
static_files: client/
upload: client/(.*\.(css|gif|png|jpg|ico|js|html))
- url: /.*
script: _go_app
我使用"dev_appserver.py test"命令启动应用程序。
当我在浏览器中打开localhost:8080或localhost:8080/index.html时,我得到一个404错误。
英文:
I have this in app.yaml
application: test
version: 1
runtime: go
api_version: go1
handlers:
- url: /
static_files: client/index.html
upload: client/index.html
- url: /index\.html
static_files: client/index.html
upload: client/index.html
- url: /(.*\.(css|gif|png|jpg|ico|js|html))
static_files: client/
upload: client/(.*\.(css|gif|png|jpg|ico|js|html))
- url: /.*
script: _go_app
I start the app with "dev_appserver.py test".
When I open in the browser localhost:8080 or localhost:8080/index.html
I get a 404
答案1
得分: 0
以下是翻译好的内容:
应用程序:测试
版本:1
运行时:Go
API 版本:go1
处理程序:
-
URL:/
静态文件:app/client/index.html
上传:app/client/index.html -
URL:/(..(css|gif|png|jpg|ico|js|html))
静态文件:app/client/\1
上传:app/client/(..(css|gif|png|jpg|ico|js|html)) -
URL:/.*
脚本:_go_app
英文:
application: test
version: 1
runtime: go
api_version: go1
handlers:
- url: /
static_files: app/client/index.html
upload: app/client/index.html
- url: /(.*\.(css|gif|png|jpg|ico|js|html))
static_files: app/client/
upload: app/client/(.*\.(css|gif|png|jpg|ico|js|html))
- url: /.*
script: _go_app
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论