53 lines
932 B
Go
53 lines
932 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/modules/rabbitmq"
|
|
"git.umbach.dev/app-idea/rest-api/routers/router"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func main() {
|
|
app := fiber.New()
|
|
|
|
config.LoadConfig()
|
|
|
|
cfg := &config.Cfg.Server
|
|
|
|
if cfg.Debug {
|
|
log.SetLevel(log.DebugLevel)
|
|
}
|
|
|
|
router.SetupRoutes(app)
|
|
|
|
database.InitDatabase()
|
|
|
|
rabbitmq.Init()
|
|
|
|
app.Listen(cfg.Host)
|
|
}
|