Skip to content

Commit

Permalink
feat: add ping
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinGao committed Aug 24, 2023
1 parent 5e2821e commit cd67bb4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/controller/0module.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package controller
import "go.uber.org/fx"

func Module() fx.Option {
return fx.Module("controller", fx.Invoke(RegisterGraphQL))
return fx.Module("controller", fx.Invoke(RegisterGraphQL), fx.Invoke(RegisterMeta))
}
18 changes: 18 additions & 0 deletions internal/controller/meta.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package controller

import (
"github.com/gofiber/fiber/v2"
"go.uber.org/fx"
)

type Meta struct {
fx.In

Route fiber.Router `name:"internal"`
}

func RegisterMeta(c GraphQL) {
c.Route.Get("/ping", func(c *fiber.Ctx) error {
return c.SendString("pong")
})
}

0 comments on commit cd67bb4

Please sign in to comment.