mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-10-21 23:46:45 +00:00
* Pass HARs between tap and api via channel. * Fixed make docker commad. * Various fixes. * Added .DS_Store to .gitignore. * Parse flags in Mizu main instead of in tap_output.go. * Use channel to pass HAR by default instead of files.
39 lines
759 B
Go
39 lines
759 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
"mizuserver/pkg/inserter"
|
|
"mizuserver/pkg/middleware"
|
|
"mizuserver/pkg/routes"
|
|
"mizuserver/pkg/tap"
|
|
"mizuserver/pkg/utils"
|
|
)
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
harOutputChannel := tap.StartPassiveTapper()
|
|
|
|
app := fiber.New()
|
|
|
|
// process to read files / channel and insert to DB
|
|
go inserter.StartReadingFiles(harOutputChannel, tap.HarOutputDir)
|
|
|
|
|
|
middleware.FiberMiddleware(app) // Register Fiber's middleware for app.
|
|
app.Static("/", "./site")
|
|
|
|
//Simple route to know server is running
|
|
app.Get("/echo", func(c *fiber.Ctx) error {
|
|
return c.SendString("Hello, World 👋!")
|
|
})
|
|
|
|
routes.WebSocketRoutes(app)
|
|
routes.EntriesRoutes(app)
|
|
routes.NotFoundRoute(app)
|
|
|
|
utils.StartServer(app)
|
|
}
|