英文:
How do I access Datastore using github.com/golang/appengine?
问题
我正在使用github.com/golang/appengine及其相关的"datastore"。我希望这个包能让我在一个普通的Go网站中使用Datastore。不幸的是,我的代码
c := appengine.NewContext(rq)
一直报错"NewContext passed an unknown http.Request"。我的app.yaml文件包含以下内容:
application: sdklessdatastoremusic
version: 1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
vm: true
manual_scaling:
instances: 1
这个YAML文件应该怎么写?还是问题出在其他地方?
英文:
I am using github.com/golang/appengine and its associated "datastore". I was hoping this package would allow me to use Datastore in a normal Go website. Unfortunately, my
c := appengine.NewContext(rq)
keeps giving my a "NewContext passed an unknown http.Request" error. My app.yaml contains
application: sdklessdatastoremusic
version: 1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
vm: true
manual_scaling:
instances: 1
What should that YAML be, or is the problem elsewhere?
答案1
得分: 1
App Engine的软件包仅适用于在App Engine本身上运行时,而不适用于其他地方。
英文:
The App Engine packages only apply for when you are running on App Engine itself, not elsewhere.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论