add api check
This commit is contained in:
1 parent
fbbb36e7d4
commit
a1fffd12aa
2 files changed
+9
-1
No files matched your search
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
)
|
||||
|
||||
const version string = "\nv0.8.4-Alpha"
|
||||
const version string = "\nv0.8.5-Alpha"
|
||||
|
||||
func main() {
|
||||
fmt.Println(version)
|
||||
|
||||
@@ -13,6 +13,14 @@ func Setup(app *fiber.App) {
|
||||
// API Handling
|
||||
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
|
||||
app.Get(routerPrefix+"/student", controllers.Student)
|
||||
app.Post(routerPrefix+"/student/enroll", controllers.Enroll)
|
||||
|
||||
Reference in new issue
Block a user