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 -u
  • _

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
  • Now listening on: http://localhost:8080
    Application started. Press CTRL+C to shut down.

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

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