Ai
1 Star 1 Fork 0

tianyuliang/iris

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 802 Bytes
一键复制 编辑 原始数据 按行查看 历史
kataras 提交于 2017-06-04 04:22 +08:00 . Publish the new version :airplane:| Look description please!
package main
import (
"net/http"
"github.com/kataras/iris"
"github.com/kataras/iris/context"
)
func main() {
app := iris.New()
app.Get("/", func(ctx context.Context) {
ctx.Writef("Hello from the server")
})
app.Get("/mypath", func(ctx context.Context) {
ctx.Writef("Hello from %s", ctx.Path())
})
srv := &http.Server{Addr: ":8080" /* Any custom fields here: Handler and ErrorLog are setted to the server automatically */}
// http://localhost:8080/
// http://localhost:8080/mypath
app.Run(iris.Server(srv)) // same as app.Run(iris.Addr(":8080"))
// More:
// see "multi" if you need to use more than one server at the same app.
//
// for a custom listener use: iris.Listener(net.Listener) or
// iris.TLS(cert,key) or iris.AutoTLS(), see "custom-listener" example for those.
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/tianyuliang/iris.git
git@gitee.com:tianyuliang/iris.git
tianyuliang
iris
iris
20f30022705b

搜索帮助