Star Follow @kataras

IRIS

The fastest backend web framework for Go.

GET STARTED GITHUB

Crossplatform

Write once and run anywhere ie. Android, iOS, Linux and Windows etc. with the minimum machine power.

Easy To Use

It is backed on Google Go, only one excutable serve on all platforms. Iris known for simple and powerful api.

Service Oriented

Iris gives you the structure to build service oriented apps. It’s easy to build microservices with Iris.

Comparison with other frameworks

Installation

Note: Assuming that you have already installed Google Go. If not please follow installation guide

  • go get -u github.com/kataras/iris
  • _

Hello World

      
         package main

         import (
           "github.com/kataras/iris"
           "github.com/kataras/iris/context"
         )

         func main() {
           app := iris.Default()

           // Method:   GET
           // Resource: http://localhost:8080/
           app.Handle("GET", "/", func(ctx context.Context) {
             ctx.HTML("Hello world!")
           })

           // same as app.Handle("GET", "/ping", [...])
           // Method:   GET
           // Resource: http://context:8080/ping
           app.Get("/ping", func(ctx context.Context) {
             ctx.WriteString("pong")
           })

           // Method:   GET
           // Resource: http://localhost:8080/hello
           app.Get("/hello", func(ctx context.Context) {
             ctx.JSON(context.Map{"message": "Hello iris web framework."})
           })

           // http://localhost:8080
           // http://localhost:8080/ping
           // http://localhost:8080/hello
           app.Run(iris.Addr(":8080"))
         }
      
    

Save above code with main.go (its up to you) and run following command to start server

  • go run main.go
  • Now listening on: http://localhost:8080
    Application started. Press CTRL+C to shut down.
    _

Get Started