英文:
Is it possible to use the martini framework on app engine
问题
使用http://martini.codegangsta.io在Google的应用引擎上是可能的吗?有人有例子吗?在我开始使用之前,有什么需要注意的地方吗?提前谢谢。
英文:
Is it possible to use http://martini.codegangsta.io on Google's app engine? Does anyone have an example? Any gotcha's that I should be aware of before going down this path? Thanks in advance.
答案1
得分: 6
只要 martini 不使用 cgo 或 unsafe
和 syscall
包,就应该没问题。
martini 的 README 包含了一个使用 martini 和 GAE 的示例,正如 @elithar 指出的那样:
package hello
import (
"net/http"
"github.com/go-martini/martini"
)
func init() {
m := martini.Classic()
m.Get("/", func() string {
return "Hello world!"
})
http.Handle("/", m)
}
另一个使用第三方包与应用引擎的示例是这个随机选择的应用引擎示例项目。
英文:
As long as martini does not use cgo or the unsafe
and syscall
package it should be fine.
The README of martini contains an example of using martini with GAE as @elithar pointed out:
package hello
import (
"net/http"
"github.com/go-martini/martini"
)
func init() {
m := martini.Classic()
m.Get("/", func() string {
return "Hello world!"
})
http.Handle("/", m)
}
Another example of using third-party packages with app engine is this randomly chosen app engine example project.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论