feat: add rest routes to take the control of flink jobs
This commit is contained in:
28
internal/rest/base.go
Normal file
28
internal/rest/base.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package rest
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/danielgtaylor/huma/v2"
|
||||
humaFiber "github.com/danielgtaylor/huma/v2/adapters/humafiber"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func Init() {
|
||||
app := fiber.New()
|
||||
config := huma.DefaultConfig("Go API", "1.0.0")
|
||||
config.Servers = []*huma.Server{{}}
|
||||
config.Components.SecuritySchemes = map[string]*huma.SecurityScheme{
|
||||
"auth": {
|
||||
Type: "http",
|
||||
Scheme: "bearer",
|
||||
BearerFormat: "JWT",
|
||||
},
|
||||
}
|
||||
api := humaFiber.New(app, config)
|
||||
|
||||
initRouter(api)
|
||||
|
||||
log.Fatal(app.Listen(fmt.Sprintf(":%s", "3000")))
|
||||
}
|
||||
Reference in New Issue
Block a user