add api check

This commit is contained in:
SowinskiBraeden committed 2022-05-21 15:18:25 -07:00
1 parent fbbb36e7d4
commit a1fffd12aa
2 files changed
+9 -1

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ import (
"github.com/gofiber/fiber/v2/middleware/cors" "github.com/gofiber/fiber/v2/middleware/cors"
) )
const version string = "\nv0.8.4-Alpha" const version string = "\nv0.8.5-Alpha"
func main() { func main() {
fmt.Println(version) fmt.Println(version)
+8
View File
@@ -13,6 +13,14 @@ func Setup(app *fiber.App) {
// API Handling // API Handling
var routerPrefix string = "/api/v1" var routerPrefix string = "/api/v1"
// API check
app.Get(routerPrefix+"/status", func(c *fiber.Ctx) error {
return c.Status(fiber.StatusOK).JSON(fiber.Map{
"success": true,
"message": "the API is active",
})
})
// Student Authentication Handler // Student Authentication Handler
app.Get(routerPrefix+"/student", controllers.Student) app.Get(routerPrefix+"/student", controllers.Student)
app.Post(routerPrefix+"/student/enroll", controllers.Enroll) app.Post(routerPrefix+"/student/enroll", controllers.Enroll)