# Iris Web Framework
[![build status](https://img.shields.io/github/workflow/status/kataras/iris/CI/master?style=for-the-badge)](https://github.com/kataras/iris/actions) [![view examples](https://img.shields.io/badge/examples%20-253-a83adf.svg?style=for-the-badge&logo=go)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/gitter/room/iris_go/community.svg?color=cc2b5e&logo=gitter&style=for-the-badge)](https://gitter.im/iris_go/community) [![donate](https://img.shields.io/badge/support-Iris-blue.svg?style=for-the-badge&logo=paypal)](https://iris-go.com/donate)
Iris is a fast, simple yet fully featured and very efficient web framework for Go.
It provides a beautifully expressive and easy to use foundation for your next website or API.
```go
package main
import "github.com/kataras/iris/v12"
func main() {
app := iris.New()
app.Get("/", func(ctx iris.Context) {
ctx.HTML("Hello %s!", "World")
})
app.Listen(":8080")
}
```
Simple Handler
```go
package main
import "github.com/kataras/iris/v12"
type (
request struct {
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
}
response struct {
ID string `json:"id"`
Message string `json:"message"`
}
)
func main() {
app := iris.New()
app.Handle("PUT", "/users/{id:uuid}", updateUser)
app.Listen(":8080")
}
func updateUser(ctx iris.Context) {
id := ctx.Params().Get("id")
var req request
if err := ctx.ReadJSON(&req); err != nil {
ctx.StopWithError(iris.StatusBadRequest, err)
return
}
resp := response{
ID: id,
Message: req.Firstname + " updated successfully",
}
ctx.JSON(resp)
}
```
> Read the [routing examples](https://github.com/kataras/iris/blob/master/_examples/routing) for more!
Handler with custom input and output arguments
[![https://github.com/kataras/iris/blob/master/_examples/dependency-injection/basic/main.go](https://user-images.githubusercontent.com/22900943/105253731-b8db6d00-5b88-11eb-90c1-0c92a5581c86.png)](https://twitter.com/iris_framework/status/1234783655408668672)
> Interesting? Read the [examples](https://github.com/kataras/iris/blob/master/_examples/dependency-injection).
Party Controller (NEW)
> Head over to the [full running example](https://github.com/kataras/iris/blob/master/_examples/routing/party-controller)!
MVC
```go
package main
import (
"github.com/kataras/iris/v12"
"github.com/kataras/iris/v12/mvc"
)
type (
request struct {
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
}
response struct {
ID uint64 `json:"id"`
Message string `json:"message"`
}
)
func main() {
app := iris.New()
mvc.Configure(app.Party("/users"), configureMVC)
app.Listen(":8080")
}
func configureMVC(app *mvc.Application) {
app.Handle(new(userController))
}
type userController struct {
// [...dependencies]
}
func (c *userController) PutBy(id uint64, req request) response {
return response{
ID: id,
Message: req.Firstname + " updated successfully",
}
}
```
Want to see more? Navigate through [mvc examples](_examples/mvc)!