Google app engine + Go + serve static files + what is wrong with the config

huangapple go评论81阅读模式
英文:

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错误。

Google app engine + Go + serve static files + what is wrong with the config

英文:

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

Google app engine + Go + serve static files + what is wrong with the config

答案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

huangapple
  • 本文由 发表于 2013年11月7日 13:07:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/19828399.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定