From 3b3a8bbe442aa1965edd488d6fb9c9a2b1ca8f40 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Tue, 11 Jun 2019 12:25:35 +0300 Subject: [PATCH] Update iris main.go relative to: https://github.com/k8s-platform-hub/hello-golang-iris/issues/1 --- microservices/api/app/main.go | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/microservices/api/app/main.go b/microservices/api/app/main.go index 9071f5d..884c894 100644 --- a/microservices/api/app/main.go +++ b/microservices/api/app/main.go @@ -1,8 +1,7 @@ package main import ( - "gopkg.in/kataras/iris.v6" - "gopkg.in/kataras/iris.v6/adaptors/httprouter" + "github.com/kataras/iris" ) // Hello response structure @@ -11,19 +10,12 @@ type Hello struct { } func main() { - app := iris.New() - - app.Adapt( - iris.DevLogger(), - httprouter.New(), - ) - + app := iris.Default() app.Get("/", index) - - app.Listen(":8080") + app.Run(iris.Addr(":8080")) } -func index(ctx *iris.Context) { +func index(ctx iris.Context) { m := Hello{"Welcome to Hasura"} - ctx.JSON(iris.StatusOK, m) + ctx.JSON(m) }