/**
 * Created by VoidArtanis on 10/22/2017
 */

package routes

import (
	"gitlab.com/pactual1/backend/controllers"

	"gitlab.com/pactual1/backend/middlewares"

	"github.com/gin-gonic/gin"
)

func InitRouter(engine *gin.Engine) {
	InitMiddleware(engine)
	authController := new(controllers.AuthController)
	engine.POST("/login",  authController.HandleLogin)
	RegisterProtectedRoutes(engine)
	RegisterPublicRoutes(engine)
	RegisterUtilityRoutes(engine)
}

func InitMiddleware(engine *gin.Engine){
	engine.Use(middlewares.CORSMiddleware());
}