add swagger
This commit is contained in:
@@ -7,7 +7,11 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
"github.com/gofiber/swagger"
|
||||
"github.com/joho/godotenv"
|
||||
|
||||
_ "acc-server-manager/docs"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -17,6 +21,10 @@ func main() {
|
||||
Immutable: true,
|
||||
})
|
||||
|
||||
app.Use(cors.New())
|
||||
|
||||
app.Get("/swagger/*", swagger.HandlerDefault)
|
||||
|
||||
file, err := os.OpenFile("logs.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)
|
||||
if err != nil {
|
||||
log.Print("Cannot open file logs.log")
|
||||
|
||||
Reference in New Issue
Block a user