可以在App Engine上使用Martini框架吗?

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

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 或 unsafesyscall 包,就应该没问题
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.

huangapple
  • 本文由 发表于 2013年11月28日 22:16:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/20268404.html
匿名

发表评论

匿名网友

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

确定