DEV Community

Santosh Anand
Santosh Anand

Posted on

2 2

Simple Server With Iris Framework

In this tutorial we will create simple server using Iris Framework.

Some features of Iris framework:

  1. MVC Pattern
  2. Powerful Routing
  3. Logging
  4. gRPC support
  5. API Versioning
package main

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

func main() {
  app := iris.New()
  app.Get("/", func(ctx iris.Context) {
    ctx.JSON(iris.Map{"Hello": "Welcome"})
  })
  err := app.Listen(":8080")
  if err != nil {
    return
  }
}
Enter fullscreen mode Exit fullscreen mode

Run program using go run main.go

Open http://localhost:8080 into browser to see the result.

Top comments (0)

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 🕒

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay