mirror of
https://github.com/kataras/iris.git
synced 2025-01-24 03:01:03 +01:00
16113fa308
Github's latest commit on markdown parser forces me to re-organise the README. Because of align="center" at markdown via html property on an html element paragraph doesn't work any more. Former-commit-id: f39e5ab0931ead65fbb6e8a867afd4ef412aedd3
533 lines
25 KiB
Markdown
533 lines
25 KiB
Markdown
<p>
|
||
|
||
<a href="http://support.iris-go.com">
|
||
<!-- 20 March 2017 note: The latest github markdown engine commit broke the align="center" -->
|
||
<img src="https://github.com/iris-contrib/website/raw/gh-pages/assets/simplicity_random_image_but_suitable_because_iris_has_the_same_slogan.gif"
|
||
title="Navigate to http://support.iris-go.com">
|
||
</a>
|
||
<br/>
|
||
|
||
Iris is an efficient and well-designed toolbox with robust set of features.<br/>Write <b>your own</b>
|
||
<b>perfect high-performance web applications</b> with unlimited <b>potentials</b>.
|
||
<br/>
|
||
|
||
If you're coming from <a href="https://nodejs.org/en/">Node.js</a> world, this is the <a href="https://github.com/expressjs/express">expressjs</a> equivalent for the <a href="https://golang.org">Go Programming Language.</a>
|
||
<br/>
|
||
|
||
<a href="https://travis-ci.org/kataras/iris"><img src="https://api.travis-ci.org/kataras/iris.svg?branch=v6&style=flat-square" alt="Build Status"></a>
|
||
<a href="http://goreportcard.com/report/kataras/iris"><img src="https://img.shields.io/badge/report%20card%20-a%2B-F44336.svg?style=flat-square" alt="http://goreportcard.com/report/kataras/iris"></a>
|
||
<a href="http://support.iris-go.com"><img src="https://img.shields.io/badge/support-page-ec2eb4.svg?style=flat-square" alt="Iris support forum"></a>
|
||
<a href="https://golang.org"><img src="https://img.shields.io/badge/powered_by-go-6362c2.svg?style=flat-square" alt="Built with GoLang"></a>
|
||
<a href="https://github.com/kataras/iris/blob/v6/HISTORY.md"><img src="https://img.shields.io/badge/codename-√Νεxτ%20-blue.svg?style=flat-square" alt="CHANGELOG/HISTORY"></a>
|
||
<br/>
|
||
<a href="https://github.com/kataras/iris/tree/v6/_examples"><img src="https://img.shields.io/badge/examples-%20repository-3362c2.svg?style=flat-square" alt="Examples for new Gophers"></a>
|
||
<a href="https://godoc.org/gopkg.in/kataras/iris.v6"><img src="https://img.shields.io/badge/docs-%20reference-5272B4.svg?style=flat-square" alt="Docs"></a>
|
||
<a href="https://kataras.rocket.chat/channel/iris"><img src="https://img.shields.io/badge/community-%20chat-00BCD4.svg?style=flat-square" alt="Chat"></a>
|
||
<a href="https://github.com/kataras/iris#buy-me-a-cup-of-coffee"><img src="https://img.shields.io/badge/buy%20me%20a%20cup%20of%20-%20coffee-F4A460.svg?logo=data:image%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiPjxwYXRoIGZpbGw9InJnYigyMjAsMjIwLDIyMCkiIGQ9Ik04ODYuNiwzMDUuM2MtNDUuNywyMDMuMS0xODcsMzEwLjMtNDA5LjYsMzEwLjNoLTc0LjFsLTUxLjUsMzI2LjloLTYybC0zLjIsMjEuMWMtMi4xLDE0LDguNiwyNi40LDIyLjYsMjYuNGgxNTguNWMxOC44LDAsMzQuNy0xMy42LDM3LjctMzIuMmwxLjUtOGwyOS45LTE4OS4zbDEuOS0xMC4zYzIuOS0xOC42LDE4LjktMzIuMiwzNy43LTMyLjJoMjMuNWMxNTMuNSwwLDI3My43LTYyLjQsMzA4LjktMjQyLjdDOTIxLjYsNDA2LjgsOTE2LjcsMzQ4LjYsODg2LjYsMzA1LjN6Ii8%2BPHBhdGggZmlsbD0icmdiKDIyMCwyMjAsMjIwKSIgZD0iTTc5MS45LDgzLjlDNzQ2LjUsMzIuMiw2NjQuNCwxMCw1NTkuNSwxMEgyNTVjLTIxLjQsMC0zOS44LDE1LjUtNDMuMSwzNi44TDg1LDg1MWMtMi41LDE1LjksOS44LDMwLjIsMjUuOCwzMC4ySDI5OWw0Ny4zLTI5OS42bC0xLjUsOS40YzMuMi0yMS4zLDIxLjQtMzYuOCw0Mi45LTM2LjhINDc3YzE3NS41LDAsMzEzLTcxLjIsMzUzLjItMjc3LjVjMS4yLTYuMSwyLjMtMTIuMSwzLjEtMTcuOEM4NDUuMSwxODIuOCw4MzMuMiwxMzAuOCw3OTEuOSw4My45TDc5MS45LDgzLjl6Ii8%2BPC9zdmc%2B" alt="Buy me a cup of coffee"></a>
|
||
|
||
<br/>
|
||
<img src="https://raw.githubusercontent.com/smallnest/go-web-framework-benchmark/4db507a22c964c9bc9774c5b31afdc199a0fe8b7/benchmark.png" alt="This benchmark measures results from 'real-world' instead of 'hello-world' application source code. | Last Update At: July 21, 2016. | Shows: Processing Time Horizontal Graph. | Who did Transparency: Third-party source | Iris version: these benchmark results are totally valid for v5. | New (go 1.8 + iris.v6) benchmarks will be published on the next techempower's fortune!" />
|
||
|
||
</p>
|
||
|
||
|
||
What you say about Iris ✌
|
||
-----------
|
||
<p>
|
||
<a href="https://dzone.com/articles/a-url-shortener-service-using-go-iris-and-bolt-ger?oid=twitter&utm_content=buffera2aca&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer">
|
||
<img width="300" src="http://iris-go.com/comment28.png" />
|
||
</a>
|
||
|
||
<a href="https://twitter.com/gelnior/status/769100480706379776">
|
||
<img width="300" src="http://iris-go.com/comment27.png" />
|
||
</a>
|
||
|
||
<br/>
|
||
|
||
<a href="https://twitter.com/_mgale/status/818591490305761280">
|
||
<img width="300" width="630" src="http://iris-go.com/comment25.png" />
|
||
</a>
|
||
|
||
<a href="https://twitter.com/MeAlex07/status/822799954188075008">
|
||
<img width="300" width="627" src="http://iris-go.com/comment26.png" />
|
||
</a>
|
||
|
||
<br/>
|
||
|
||
|
||
<a href="https://www.youtube.com/watch?v=jGx0LkuUs4A">
|
||
<img width="300"
|
||
src="https://github.com/iris-contrib/website/raw/gh-pages/assets/gif_link_to_yt.gif" alt="What people say" />
|
||
</a>
|
||
|
||
<a href="https://www.youtube.com/watch?v=jGx0LkuUs4A">
|
||
<img width ="300" src="https://github.com/iris-contrib/website/raw/gh-pages/assets/gif_link_to_yt2.gif" alt="What people say" />
|
||
</a>
|
||
|
||
</p>
|
||
|
||
Legends [♡](https://github.com/kataras/iris#support)
|
||
-----------
|
||
|
||
[Juan Sebastián Suárez Valencia](https://github.com/Juanses) donated 20 EUR at September 11 of 2016
|
||
|
||
[Bob Lee](https://github.com/li3p) donated 20 EUR at September 16 of 2016
|
||
|
||
[Celso Luiz](https://github.com/celsosz) donated 50 EUR at September 29 of 2016
|
||
|
||
[Ankur Srivastava](https://github.com/ansrivas) donated 20 EUR at October 2 of 2016
|
||
|
||
[Damon Zhao](https://github.com/se77en) donated 20 EUR at October 21 of 2016
|
||
|
||
[exponity - consulting & digital transformation](https://github.com/exponity) donated 30 EUR at November 4 of 2016
|
||
|
||
[Thomas Fritz](https://github.com/thomasfr) donated 25 EUR at Jenuary 8 of 2017
|
||
|
||
[Thanos V.](http://mykonosbiennale.com/) donated 20 EUR at Jenuary 16 of 2017
|
||
|
||
[George Opritescu](https://github.com/International) donated 20 EUR at February 7 of 2017
|
||
|
||
[Lex Tang](https://github.com/lexrus) donated 20 EUR at February 22 of 2017
|
||
|
||
ANYNOMOUS[*](https://github.com/kataras/iris#support) donated 336 EUR
|
||
|
||
Feature Overview
|
||
-----------
|
||
|
||
- Focus on high performance
|
||
- Automatically install and serve certificates from https://letsencrypt.org
|
||
- Robust routing and middleware ecosystem
|
||
- Build RESTful APIs
|
||
- Choose your favorite routes' path syntax between [httprouter](https://github.com/kataras/iris/blob/v6/adaptors/httprouter/_example/main.go) and [gorillamux](https://github.com/kataras/iris/blob/v6/adaptors/gorillamux/_example/main.go)
|
||
- Request-Scoped Transactions
|
||
- Group API's and subdomains with wildcard support
|
||
- 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
|
||
- Define virtual hosts and (wildcard) subdomains with path level routing
|
||
- Graceful shutdown
|
||
- Limit request body
|
||
- Localization i18N
|
||
- Serve static 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
|
||
- Add / Remove trailing slash from the URL with option to redirect
|
||
- Redirect requests
|
||
- HTTP to HTTPS
|
||
- HTTP to HTTPS WWW
|
||
- HTTP to HTTPS non WWW
|
||
- Non WWW to WWW
|
||
- WWW to non WWW
|
||
- Highly scalable rich content render (Markdown, JSON, JSONP, XML...)
|
||
- Websocket-only API similar to socket.io
|
||
- Hot Reload on source code changes
|
||
- Typescript integration + Web IDE
|
||
- Checks for updates at startup
|
||
- Highly customizable
|
||
- Feels like you used iris forever, thanks to its Fluent API
|
||
- And many others...
|
||
|
||
Installation
|
||
-----------
|
||
|
||
The only requirement is the [Go Programming Language](https://golang.org/dl/), at least 1.8
|
||
|
||
```sh
|
||
$ go get gopkg.in/kataras/iris.v6
|
||
```
|
||
|
||
For further installation support, navigate [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
|
||
|
||
|
||
Overview
|
||
-----------
|
||
|
||
```go
|
||
package main
|
||
|
||
import (
|
||
"gopkg.in/kataras/iris.v6"
|
||
"gopkg.in/kataras/iris.v6/adaptors/cors"
|
||
"gopkg.in/kataras/iris.v6/adaptors/httprouter"
|
||
"gopkg.in/kataras/iris.v6/adaptors/view"
|
||
)
|
||
|
||
func main() {
|
||
// Receives optional iris.Configuration{}, see ./configuration.go
|
||
// for more.
|
||
app := iris.New()
|
||
|
||
// Order doesn't matter,
|
||
// You can split it to different .Adapt calls.
|
||
// See ./adaptors folder for more.
|
||
app.Adapt(
|
||
// adapt a logger which prints all errors to the os.Stdout
|
||
iris.DevLogger(),
|
||
// adapt the adaptors/httprouter or adaptors/gorillamux
|
||
httprouter.New(),
|
||
// 5 template engines are supported out-of-the-box:
|
||
//
|
||
// - standard html/template
|
||
// - amber
|
||
// - django
|
||
// - handlebars
|
||
// - pug(jade)
|
||
//
|
||
// Use the html standard engine for all files inside "./views" folder with extension ".html"
|
||
view.HTML("./views", ".html"),
|
||
// Cors wrapper to the entire application, allow all origins.
|
||
cors.New(cors.Options{AllowedOrigins: []string{"*"}}))
|
||
|
||
// http://localhost:6300
|
||
// Method: "GET"
|
||
// Render ./views/index.html
|
||
app.Get("/", func(ctx *iris.Context) {
|
||
ctx.Render("index.html", iris.Map{"Title": "Page Title"}, iris.RenderOptions{"gzip": true})
|
||
})
|
||
|
||
// Group routes, optionally: share middleware, template layout and custom http errors.
|
||
userAPI := app.Party("/users", userAPIMiddleware).
|
||
Layout("layouts/userLayout.html")
|
||
{
|
||
// Fire userNotFoundHandler when Not Found
|
||
// inside http://localhost:6300/users/*anything
|
||
userAPI.OnError(404, userNotFoundHandler)
|
||
|
||
// http://localhost:6300/users
|
||
// Method: "GET"
|
||
userAPI.Get("/", getAllHandler)
|
||
|
||
// http://localhost:6300/users/42
|
||
// Method: "GET"
|
||
userAPI.Get("/:id", getByIDHandler)
|
||
|
||
// http://localhost:6300/users
|
||
// Method: "POST"
|
||
userAPI.Post("/", saveUserHandler)
|
||
}
|
||
|
||
// Start the server at 127.0.0.1:6300
|
||
app.Listen(":6300")
|
||
}
|
||
|
||
func userAPIMiddleware(ctx *iris.Context) {
|
||
// your code here...
|
||
println("Request: " + ctx.Path())
|
||
ctx.Next() // go to the next handler(s)
|
||
}
|
||
|
||
func userNotFoundHandler(ctx *iris.Context) {
|
||
// your code here...
|
||
ctx.HTML(iris.StatusNotFound, "<h1> User page not found </h1>")
|
||
}
|
||
|
||
func getAllHandler(ctx *iris.Context) {
|
||
// your code here...
|
||
}
|
||
|
||
func getByIDHandler(ctx *iris.Context) {
|
||
// take the :id from the path, parse to integer
|
||
// and set it to the new userID local variable.
|
||
userID, _ := ctx.ParamInt("id")
|
||
|
||
// userRepo, imaginary database service <- your only job.
|
||
user := userRepo.GetByID(userID)
|
||
|
||
// send back a response to the client,
|
||
// .JSON: content type as application/json; charset="utf-8"
|
||
// iris.StatusOK: with 200 http status code.
|
||
//
|
||
// send user as it is or make use of any json valid golang type,
|
||
// like the iris.Map{"username" : user.Username}.
|
||
ctx.JSON(iris.StatusOK, user)
|
||
}
|
||
|
||
func saveUserHandler(ctx *iris.Context) {
|
||
// your code here...
|
||
}
|
||
```
|
||
|
||
### Reload on source code changes
|
||
|
||
```sh
|
||
$ go get -u github.com/kataras/rizla
|
||
$ cd $GOPATH/src/mywebapp
|
||
$ rizla main.go
|
||
```
|
||
|
||
### Reload templates on each incoming request
|
||
|
||
```go
|
||
app.Adapt(view.HTML("./views", ".html").Reload(true))
|
||
```
|
||
|
||
|
||
FAQ & Documentation
|
||
-----------
|
||
|
||
<a href="https://github.com/kataras/iris/tree/v6/_examples"><img align="right" width="125" src="https://raw.githubusercontent.com/iris-contrib/website/gh-pages/assets/book/cover_4.jpg"></a>
|
||
|
||
1. [Getting Started with Go+Iris](http://gopherbook.iris-go.com)
|
||
|
||
2. Official small but practical [examples](https://github.com/kataras/iris/tree/v6/_examples)
|
||
|
||
3. Navigate through [community examples](https://github.com/iris-contrib/examples) too
|
||
|
||
4. [DZone: A URL Shortener Service Using Go, Iris, and Bolt](https://dzone.com/articles/a-url-shortener-service-using-go-iris-and-bolt-ger?oid=twitter&utm_content=buffera2aca&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer)
|
||
|
||
5. [./adaptors](https://github.com/kataras/iris/tree/v6/adaptors) and [./middleware](https://github.com/kataras/iris/tree/v6/middleware) contains examples of their usage
|
||
|
||
6. [Godocs](https://godoc.org/gopkg.in/kataras/iris.v6) for deep documentation
|
||
|
||
|
||
7. [HISTORY.md](https://github.com//kataras/iris/tree/v6/HISTORY.md) is your best friend, version migrations are released there
|
||
|
||
|
||
I'll be glad to talk with you about **your awesome feature requests**,
|
||
open a new [discussion](http://support.iris-go.com), you will be heard!
|
||
|
||
|
||
|
||
Support
|
||
------------
|
||
|
||
- :star: [the project](https://github.com/kataras/iris/stargazers), will help you to follow the upcoming features
|
||
- [Donate](https://github.com/kataras/iris#buy-me-a-cup-of-coffee), will help me to continue
|
||
- [Post](http://support.iris-go.com) a feature request or report a bug, will help all of us to build a better web, together
|
||
- :earth_americas: post [an article](https://dzone.com/articles/a-url-shortener-service-using-go-iris-and-bolt-ger) or [tweet](https://twitter.com/gelnior/status/769100480706379776) and share it with your neighbor
|
||
|
||
|
||
<!--It's true that I am spending all my available time for Iris and its related projects, therefore I have no income value.
|
||
|
||
However, I am not asking from people to change the system. I know that the majority of us(devs) don't really care how authors of projects like Iris survive. I totally understand that.
|
||
|
||
If somebody out there can
|
||
help developers like me to worry less about daily life's dilemmas it would be easier for them to make the particular project(s) even better.
|
||
There are no limits to the Iris' potentials.
|
||
|
||
|
||
I am a realistic person. If things won't change for my daily life I will be forced to give Iris' managment to somebody else(that community could trust).-->
|
||
|
||
Buy me a cup of coffee?
|
||
------------
|
||
|
||
Iris is free and open source but developing it has taken thousands of hours of my time and a large part of my sanity. If you feel this web framework useful to you, it would go a great way to ensuring that I can afford to take the time to continue to develop it.
|
||
|
||
|
||
I spend all my time in the construction of Iris, therefore I have no income value.
|
||
|
||
Feel free to send **any** amount through paypal
|
||
|
||
[![](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.me/kataras/)
|
||
|
||
> Please check your e-mail after your donation.
|
||
|
||
|
||
Thanks for your gratitude and finance help ♡
|
||
|
||
|
||
<!--
|
||
|
||
Some of the benefits are listed here:
|
||
|
||
- Your github username, after your approval, is visible at the top of the README page.
|
||
- Access to the 'donors' [private chat room](https://kataras.rocket.chat/group/donors) gives you real-time assistance by Iris' Author.
|
||
|
||
-->
|
||
|
||
<!--
|
||
|
||
### Become An Iris Sponsor
|
||
|
||
Want to add your company's logo to our [website](http://iris-go.com)?
|
||
|
||
Please contact me via email: kataras2006@hotmail.com
|
||
|
||
Thank you!
|
||
|
||
-->
|
||
|
||
|
||
Third Party Middleware
|
||
------------
|
||
|
||
Iris has its own middleware form of `func(ctx *iris.Context)` but it's also compatible with all `net/http` middleware forms using [iris.ToHandler](https://github.com/iris-contrib/middleware/blob/master/cors/cors.go#L33), i.e Negroni's middleware form of `func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)`.
|
||
|
||
Here is a small list of Iris compatible middleware, I'm sure you can find more:
|
||
|
||
| Middleware | Author | Description |
|
||
| -----------|--------|-------------|
|
||
| [binding](https://github.com/mholt/binding) | [Matt Holt](https://github.com/mholt) | Data binding from HTTP requests into structs |
|
||
| [cloudwatch](https://github.com/cvillecsteele/negroni-cloudwatch) | [Colin Steele](https://github.com/cvillecsteele) | AWS cloudwatch metrics middleware |
|
||
| [csp](https://github.com/awakenetworks/csp) | [Awake Networks](https://github.com/awakenetworks) | [Content Security Policy](https://www.w3.org/TR/CSP2/) (CSP) support |
|
||
| [delay](https://github.com/jeffbmartinez/delay) | [Jeff Martinez](https://github.com/jeffbmartinez) | Add delays/latency to endpoints. Useful when testing effects of high latency |
|
||
| [New Relic Go Agent](https://github.com/yadvendar/negroni-newrelic-go-agent) | [Yadvendar Champawat](https://github.com/yadvendar) | Official [New Relic Go Agent](https://github.com/newrelic/go-agent) (currently in beta) |
|
||
| [gorelic](https://github.com/jingweno/negroni-gorelic) | [Jingwen Owen Ou](https://github.com/jingweno) | New Relic agent for Go runtime |
|
||
| [JWT Middleware](https://github.com/auth0/go-jwt-middleware) | [Auth0](https://github.com/auth0) | Middleware checks for a JWT on the `Authorization` header on incoming requests and decodes it|
|
||
| [logrus](https://github.com/meatballhat/negroni-logrus) | [Dan Buch](https://github.com/meatballhat) | Logrus-based logger |
|
||
| [onthefly](https://github.com/xyproto/onthefly) | [Alexander Rødseth](https://github.com/xyproto) | Generate TinySVG, HTML and CSS on the fly |
|
||
| [permissions2](https://github.com/xyproto/permissions2) | [Alexander Rødseth](https://github.com/xyproto) | Cookies, users and permissions |
|
||
| [prometheus](https://github.com/zbindenren/negroni-prometheus) | [Rene Zbinden](https://github.com/zbindenren) | Easily create metrics endpoint for the [prometheus](http://prometheus.io) instrumentation tool |
|
||
| [render](https://github.com/unrolled/render) | [Cory Jacobsen](https://github.com/unrolled) | Render JSON, XML and HTML templates |
|
||
| [RestGate](https://github.com/pjebs/restgate) | [Prasanga Siripala](https://github.com/pjebs) | Secure authentication for REST API endpoints |
|
||
| [secure](https://github.com/unrolled/secure) | [Cory Jacobsen](https://github.com/unrolled) | Middleware that implements a few quick security wins |
|
||
| [stats](https://github.com/thoas/stats) | [Florent Messa](https://github.com/thoas) | Store information about your web application (response time, etc.) |
|
||
| [VanGoH](https://github.com/auroratechnologies/vangoh) | [Taylor Wrobel](https://github.com/twrobel3) | Configurable [AWS-Style](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) HMAC authentication middleware |
|
||
| [xrequestid](https://github.com/pilu/xrequestid) | [Andrea Franz](https://github.com/pilu) | Middleware that assigns a random X-Request-Id header to each request |
|
||
| [digits](https://github.com/bamarni/digits) | [Bilal Amarni](https://github.com/bamarni) | Middleware that handles [Twitter Digits](https://get.digits.com/) authentication |
|
||
|
||
Feel free to put up a [PR](https://github.com/iris-contrib/middleware) your middleware!
|
||
|
||
<!--
|
||
|
||
FAQ
|
||
-----------
|
||
|
||
<p>
|
||
|
||
|
||
|
||
</p>
|
||
|
||
> Q: OK Iris is really fast, but my current website does not need that performance at the moment, are there other reasons to move into Iris?
|
||
|
||
|
||
Iris is fully vendored. That means it is independent of any API changes in the used libraries and **will work seamlessly in the future**!
|
||
|
||
The size of the executable file is a critical part of the Application Deployment Process.
|
||
|
||
Two very simple identical applications, the first was written with `iris` and the second with a simple golang router.
|
||
|
||
- _iris_ had `8.505 KB` overall file size
|
||
- _gin_ had `9.029 KB` overall file size
|
||
- _net/http_ had produced an executable file with `5.380 KB` size.
|
||
|
||
|
||
> Iris has built'n support for the most of the features that you will use to craft your perfect web application, while the golang router(gin & httprouter alone) doesn't. Imagine what would happened if the simple app we created would use `sessions`, `websockets`, `view engine`... I tested that too, `gin` and `net/http` had produced the x3 of their original size, **while `iris application`' overall executable filesize remained stable**!
|
||
|
||
|
||
**Applications that are written using Iris produce smaller file size even if they use more features** than a simple router library!
|
||
|
||
|
||
Iris always follows the latest trends and best practices. Iris is the **Secret To Staying One Step Ahead of Your Competition**.
|
||
|
||
|
||
Iris is **a high-performance** tool, but it doesn't stops there. Performance depends on your application too, **Iris helps you to make the right choices** on every step.
|
||
|
||
**Familiar** and easy **API**. Sinatra-like REST API.
|
||
|
||
Contains examples and documentation for all its features.
|
||
|
||
Iris is a `low-level access` web framework, you always know what you're doing.
|
||
|
||
You'll **never miss a thing** from `net/http`, but if you do on some point, no problem because Iris is fully compatible with stdlib, you still have access to `http.ResponseWriter` and `http.Request`, you can adapt any third-party middleware of form `func(http.ResponseWriter, *http.Request, next http.HandlerFunc)` as well.
|
||
|
||
Iris is a community-driven project, **you suggest and I code**.
|
||
|
||
Unlike other repositories, this one is **very active**. When you post an issue, you get an answer at the next couple of minutes(hours at the worst). If you find a bug, **I am obliged to fix** that on the same day.
|
||
|
||
|
||
Click the below animation to see by your self what people, like you, say about Iris.
|
||
|
||
<a href="https://www.youtube.com/watch?v=jGx0LkuUs4A">
|
||
<img src="https://github.com/iris-contrib/website/raw/gh-pages/assets/gif_link_to_yt2.gif" alt="What people say" />
|
||
</a>
|
||
|
||
|
||
|
||
> Q: Why no `serverless`?
|
||
|
||
New web developers are so enthusiastic about the idea of `serverless` and `AWS`. Most of the experienced developers we already know that we shouldn't use these things for our critical parts of our application.
|
||
|
||
|
||
**`Serverless and AWS` Are Wonderful—Until They Go Wrong.** There was a flash-point (at 28 February of 2017) where the 'internet was offline' and most of the sites, including isitdownrightnow.com, were down or operated very slow! Why? Because of `serverless` and `AmazonS3`.
|
||
Please think twice before moving your code into `serverless`, **instead, use web frameworks that are created for servers that you control**, i.e Iris.
|
||
|
||
Proof of concept:
|
||
|
||
- [Washington Post](https://www.washingtonpost.com/news/the-switch/wp/2017/02/28/why-a-whole-slew-of-websites-are-suddenly-down-or-working-slowly)
|
||
- [CNN](http://money.cnn.com/2017/02/28/technology/amazon-web-services-outages/index.html)
|
||
- [CNET](https://www.cnet.com/news/no-the-internet-is-not-broken-amazon-web-services-is-just-having-issues/?ftag=COS-05-10-aa0a&linkId=34980800)
|
||
- [MIT Technology Review](https://www.technologyreview.com/s/603738/centralized-web-services-are-wonderful-until-they-go-wrong/?_ga=1.82562070.1263144274.1488319022)
|
||
- [GolangNews](https://golangnews.com/stories/1835-serverless-is-wonderfuluntil-they-go-wrong.)
|
||
|
||
|
||
|
||
|
||
|
||
Explore [these questions](http://support.iris-go.com/) and join to our [community chat][Chat]!
|
||
|
||
-->
|
||
|
||
Testing
|
||
------------
|
||
|
||
The `httptest` package is a simple Iris helper for the httpexpect, a new library for End-to-end HTTP and REST API testing for Go.
|
||
|
||
You can find tests by navigating to the source code,
|
||
i.e:
|
||
|
||
- [context_test.go](https://github.com/kataras/iris/blob/v6/context_test.go)
|
||
- [handler_test.go](https://github.com/kataras/iris/blob/v6/handler_test.go)
|
||
- [policy_gorillamux_test.go](https://github.com/kataras/iris/blob/v6/policy_gorillamux_test.go)
|
||
- [policy_httprouter_test.go](https://github.com/kataras/iris/blob/v6/policy_httprouter_test.go)
|
||
- [policy_nativerouter_test.go](https://github.com/kataras/iris/blob/v6/policy_nativerouter_test.go)
|
||
- [policy_routerwrapper_test.go](https://github.com/kataras/iris/blob/v6/policy_routerwrapper_test.go)
|
||
- [policy_sessions_test.go](https://github.com/kataras/iris/blob/v6/policy_sessions_test.go)
|
||
- [response_writer_test.go](https://github.com/kataras/iris/blob/v6/response_writer_test.go)
|
||
- [route_test.go](https://github.com/kataras/iris/blob/v6/route_test.go)
|
||
- [status_test.go](https://github.com/kataras/iris/blob/v6/status_test.go)
|
||
- [transaction_test.go](https://github.com/kataras/iris/blob/v6/transaction_test.go)
|
||
- [serializer_test.go](https://github.com/kataras/iris/blob/v6/serializer_test.go)
|
||
|
||
A simple test is located to [./httptest/_example/main_test.go](https://github.com/kataras/iris/blob/v6/httptest/_example/main_test.go)
|
||
|
||
Philosophy
|
||
------------
|
||
|
||
The Iris philosophy is to provide robust tooling for HTTP, making it a great solution for single page applications, web sites, hybrids, or public HTTP APIs. Keep note that, today, iris is faster than nginx itself.
|
||
|
||
Iris does not force you to use any specific ORM or template engine. Iris is routerless which means you can adapt any router you like, [httprouter](https://github.com/kataras/iris/blob/v6/adaptors/httprouter/_example/main.go) is the fastest, [gorillamux](https://github.com/kataras/iris/blob/v6/adaptors/gorillamux/_example/main.go) has more features. With support for the most used template engines (5), you can quickly craft the perfect application.
|
||
|
||
|
||
People
|
||
------------
|
||
|
||
The author of Iris is [@kataras](https://github.com/kataras).
|
||
|
||
However the real Success of Iris belongs to you with your bug reports and feature requests that made this Framework so Unique.
|
||
|
||
|
||
Contact
|
||
------------
|
||
|
||
Besides the fact that we have a [community chat][Chat] for questions or reports and ideas, [stackoverflow](http://stackoverflow.com/) section for generic go+iris questions and the [iris support](http://support.iris-go.com) for bug reports and feature requests, you can also contact with me, as a person who is always open to help you:
|
||
|
||
- [Twitter](https://twitter.com/MakisMaropoulos)
|
||
- [Facebook](https://facebook.com/kataras.gopher)
|
||
- [Linkedin](https://www.linkedin.com/in/gerasimos-maropoulos)
|
||
|
||
|
||
Codename: ["√Νεxτ"](https://github.com/kataras/iris/blob/v6/HISTORY.md)
|
||
------------
|
||
|
||
License
|
||
------------
|
||
|
||
Unless otherwise noted, the source files are distributed
|
||
under the MIT License found in the [LICENSE file](LICENSE).
|
||
|
||
Note that some optional components that you may use with Iris requires
|
||
different license agreements.
|
||
|
||
|
||
[Chat]: https://kataras.rocket.chat/channel/iris
|