appidea-restapi/main.go

51 lines
987 B
Go

// App-Idea Rest-API Documentation
//
// Example Swagger spec.
//
// Schemes: [http, https]
// BasePath: /api/v1/
// Version: 0.0.1
// Contact: Alex<alex@roese.dev>
//
// Consumes:
// - application/json
//
// Produces:
// - application/json
//
// SecurityDefinitions:
// api_key:
// type: apiKey
// name: Authorization
// in: header
// swagger:meta
package main
import (
"git.umbach.dev/app-idea/rest-api/modules/config"
"git.umbach.dev/app-idea/rest-api/modules/database"
"git.umbach.dev/app-idea/rest-api/routers/router"
_ "github.com/go-sql-driver/mysql"
"github.com/gofiber/fiber/v2"
)
func main() {
app := fiber.New()
router.SetupRoutes(app)
config.LoadConfig()
database.InitDatabase()
app.Listen(config.GetConfig().Server.Host)
}
/*
swagger generate spec -o ./swagger.yaml
sudo docker run -p 80:8080 -e SWAGGER_JSON=/api.yaml -v ~/Documents/coding/go/rest-api/swagger.yaml:/api.yaml swaggerapi/swagger-ui
*/