# ![Logo created by @santoshanand](logo_white_35_24.png) Iris Iris is a fast, simple and efficient micro web framework for Go. It provides a beautifully expressive and easy to use foundation for your next website, API, or distributed app. Web applications powered by Iris run everywhere, even [from an android device](https://medium.com/@kataras/how-to-turn-an-android-device-into-a-web-server-9816b28ab199). [![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) [![godocs](https://img.shields.io/badge/godocs-8.x.x-0366d6.svg?style=flat-square)](https://godoc.org/github.com/kataras/iris) [![get support](https://img.shields.io/badge/get-support-cccc00.svg?style=flat-square)](http://support.iris-go.com) [![view examples](https://img.shields.io/badge/learn%20by-examples-0077b3.svg?style=flat-square)](https://github.com/kataras/iris/tree/master/_examples) [![chat](https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square)](https://kataras.rocket.chat/channel/iris) ### π₯ Hot features - Focus on high performance - Easy Fluent API - Highly customizable - Robust routing and middleware ecosystem * build RESTful APIs with iris unique expressionist path interpreter * dynamic path parameterized or wildcard routes are not conflict with static routes * remove trailing slash from the URL with option to redirect * virtual hosts and subdomains made easy * group API's and static or even dynamic subdomains * `net/http` and `negroni-like` handlers are compatible via `iris.FromStd` * [learn the reasons that differ from what you've seen so far](_examples/#routing-grouping-dynamic-path-parameters-macros-and-custom-context) - Automatically install and serve certificates from https://letsencrypt.org - Request-Scoped Transactions - Body binding for JSON, XML, Forms, can be extended to use your own custom binders - More than 50 handy functions to send HTTP responses - View system: supporting more than 6+ template engines, with prerenders. You can still use your favorite - Graceful shutdown - Limit request body - Localization i18N - Serve static and embedded files - Cache - Log requests - Customizable format and output for the logger - Customizable HTTP errors - Compression (Gzip) - Authentication - OAuth, OAuth2 supporting 27+ popular websites - JWT - Basic Authentication - HTTP Sessions. You can still use your favorite - HTTP to HTTPS - HTTP to HTTPS WWW - Highly scalable rich content render (Markdown, JSON, JSONP, XML...) - Websocket-only API similar to socket.io. You can still use your favorite - Hot Reload on source code changes[*](https://github.com/kataras/rizla) - Typescript integration + Web IDE - And many other things that will surprise you
### π Table of contents * [Installation](#-installation) * [Latest changes](https://github.com/kataras/iris/blob/master/HISTORY.md#su-15-july-2017--v802) * [Learn](#-learn) * [HTTP Listening](_examples/#http-listening) * [Configuration](_examples/#configuration) * [Routing, Grouping, Dynamic Path Parameters, "Macros" and Custom Context](_examples/#routing-grouping-dynamic-path-parameters-macros-and-custom-context) * [Subdomains](_examples/#subdomains) * [Wrap `http.Handler/HandlerFunc`](_examples/#convert-httphandlerhandlerfunc) * [View](_examples/#view) * [Authentication](_examples/#authentication) * [File Server](_examples/#file-server) * [How to Read from `context.Request() *http.Request`](_examples/#how-to-read-from-contextrequest-httprequest) * [How to Write to `context.ResponseWriter() http.ResponseWriter`](_examples/#how-to-write-to-contextresponsewriter-httpresponsewriter) * [Test](_examples/#testing) * [Cache](cache/#table-of-contents) * [Sessions](sessions/#table-of-contents) * [Websockets](websocket/#table-of-contents) * [Miscellaneous](_examples/#miscellaneous) * [Typescript Automation Tools](typescript/#table-of-contents) * [Tutorial: Online Visitors](_examples/tutorial/online-visitors) * [Tutorial: URL Shortener using BoltDB](https://medium.com/@kataras/a-url-shortener-service-using-go-iris-and-bolt-4182f0b00ae7) * [Tutorial: How to turn your Android Device into a fully featured Web Server](https://medium.com/@kataras/how-to-turn-an-android-device-into-a-web-server-9816b28ab199) * [Middleware](middleware/) * [Dockerize](https://github.com/iris-contrib/cloud-native-go) * [Philosophy](#-philosophy) * [Support](#-support) * [Versioning](#-version) * [When should I upgrade?](#should-i-upgrade-my-iris) * [Where can I find older versions?](#where-can-i-find-older-versions) * [People](#-people) ### π Installation The only requirement is the [Go Programming Language](https://golang.org/dl/), at least version 1.8 ```sh $ go get -u github.com/kataras/iris ``` > _iris_ takes advantage of the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature. You get truly reproducible builds, as this method guards against upstream renames and deletes. ```go // file: main.go package main import ( "github.com/kataras/iris" "github.com/kataras/iris/context" ) func main() { app := iris.New() // Load all templates from the "./templates" folder // where extension is ".html" and parse them // using the standard `html/template` package. app.RegisterView(iris.HTML("./templates", ".html")) // Method: GET // Resource: http://localhost:8080 app.Get("/", func(ctx context.Context) { // Bind: {{.message}} with "Hello world!" ctx.ViewData("message", "Hello world!") // Render template file: ./templates/hello.html ctx.View("hello.html") }) // Start the server using a network address and block. app.Run(iris.Addr(":8080")) } ``` ```html