mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-13 21:30:04 +00:00
Add api build and clean to makefile (files restructure) (#9)
* no message * add clean api command
This commit is contained in:
15
api/pkg/routes/not_found_route.go
Normal file
15
api/pkg/routes/not_found_route.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package routes
|
||||
|
||||
import "github.com/gofiber/fiber/v2"
|
||||
|
||||
// NotFoundRoute func for describe 404 Error route.
|
||||
func NotFoundRoute(fiberApp *fiber.App) {
|
||||
fiberApp.Use(
|
||||
func(c *fiber.Ctx) error {
|
||||
return c.Status(fiber.StatusNotFound).JSON(fiber.Map{
|
||||
"error": true,
|
||||
"msg": "sorry, endpoint is not found",
|
||||
})
|
||||
},
|
||||
)
|
||||
}
|
17
api/pkg/routes/public_routes.go
Normal file
17
api/pkg/routes/public_routes.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"mizuserver/pkg/controllers"
|
||||
)
|
||||
|
||||
// EntriesRoutes func for describe group of public routes.
|
||||
func EntriesRoutes(fiberApp *fiber.App) {
|
||||
routeGroup := fiberApp.Group("/api")
|
||||
|
||||
routeGroup.Get("/entries", controllers.GetEntries) // get entries (base/thin entries)
|
||||
routeGroup.Get("/entries/:entryId", controllers.GetEntry) // get single (full) entry
|
||||
|
||||
routeGroup.Get("/resetDB", controllers.DeleteAllEntries) // get single (full) entry
|
||||
|
||||
}
|
Reference in New Issue
Block a user