# Iris Web Framework
[![build status](https://img.shields.io/travis/kataras/iris/master.svg?style=flat-square)](https://travis-ci.org/kataras/iris) [![report card](https://img.shields.io/badge/report%20card-a%2B-ff3333.svg?style=flat-square)](http://goreportcard.com/report/kataras/iris) [![vscode-iris](https://img.shields.io/badge/ext%20-vscode-0c77e3.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=kataras2006.iris) [![chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://kataras.rocket.chat/channel/iris) [![view examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/tree/master/_examples/routing) [![release](https://img.shields.io/badge/release%20-v11.0-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/releases)
Iris 是一款超快、简洁高效的 Go 语言 Web开发框架。
Iris 功能强大、使用简单,它将会是你下一个网站、API 服务或者分布式应用基础框架的不二之选。
总之,是一款与 express.js 旗鼓相当的 Go 语言框架。
看看[别人是如何评价 Iris](#support),同时欢迎各位点亮 Iris [Star](https://github.com/kataras/iris/stargazers),或者关注 [Iris facebook 主页](https://facebook.com/iris.framework)。
## 支持者
感谢所有的支持者! 🙏 [支持我们](https://iris-go.com/donate)
```sh
$ cat example.go
```
```go
package main
import "github.com/kataras/iris"
func main() {
app := iris.New()
// 从 "./views" 目录加载HTML模板
// 模板解析 html 后缀文件
// 此方式使用 `html/template` 标准包 (Iris 的模板引擎)
app.RegisterView(iris.HTML("./views", ".html"))
// 方法:GET
// 路径:http://localhost:8080
app.Get("/", func(ctx iris.Context) {
// {{.message}} 和 "Hello world!" 字符串变量绑定
ctx.ViewData("message", "Hello world!")
// 映射 HTML 模板文件路径 ./views/hello.html
ctx.View("hello.html")
})
//方法:GET
//路径:http://localhost:8080/user/42
//
// 使用正则表达式必须设置参数类型为 string
// app.Get("/user/{id:string regexp(^[0-9]+$)}")
app.Get("/user/{id:long}", func(ctx iris.Context) {
userID, _ := ctx.Params().GetInt64("id")
ctx.Writef("User ID: %d", userID)
})
// 绑定端口并启动服务.
app.Run(iris.Addr(":8080"))
}
```
> 想要了解更多关于路径参数配置,戳[这里](_examples/routing/dynamic-path/main.go#L31)。
```html