Getting Started

Assuming that you have intermediate knowledge about terminal.

Iris has only one prerequisite and that is Google Go . You can install it using their installation guide or with Home Brew (on MacOS)

It is very simple to install Google Go using Home Brew on MacOS, just type following command on terminal.

  • brew install go
  • _

Install Iris

Type following command on Terminal and hit enter to install Iris.

  • go get gopkg.in/kataras/iris.v6
  • _

Simple Server

Create a working directory using mkdir $GOPATH/src/gowork, you can name anything you want instead of gowork. Now go to your working directory using cd $GOPATH/src/gowork and create a file main.go, file name is up to you.

Open terminal and run following commands one by one.

  • mkdir $GOPATH/src/gowork
  • cd $GOPATH/src/gowork
  • touch main.go
  • _

Open main.go file in any editor and put following code in it.


  

Time to run your server, so just type go run main.go

  • go run main.go
  • _

Finally open your browser and try to open http://localhost:8080/

Great! you have a very simple server running using Iris.