func main() {
	gin.SetMode(gin.ReleaseMode)

	s := loadServerCtx()
	if s.Debug {
		log.SetLevel(log.DebugLevel)
		gin.SetMode(gin.DebugMode)
	}

	c, err := statsdClient(s.StatsdUrl)
	if err != nil {
		log.WithField("statsdUrl", s.StatsdUrl).Fatal("Could not connect to statsd")
	}

	r := gin.Default()
	r.GET("/status", func(c *gin.Context) {
		c.String(200, "OK")
	})

	if len(s.AppPasswd) > 0 {
		auth := r.Group("/", gin.BasicAuth(s.AppPasswd))
		auth.POST("/", s.processLogs)
	}

	s.in = make(chan *logData, bufferLen)
	defer close(s.in)
	s.out = make(chan *logMetrics, bufferLen)
	defer close(s.out)
	go logProcess(s.in, s.out)
	go c.sendToStatsd(s.out)
	log.Infoln("Server ready ...")
	r.Run(":" + s.Port)

}
Esempio n. 2
0
// NewWebServer : create and configure a new web server
func NewWebServer(c *Config, l *Store, level int) *WebHandler {
	wh := &WebHandler{}
	// create the router
	if level == 0 {
		gin.SetMode(gin.ReleaseMode)
		wh.router = gin.New()
	}
	if level == 1 {
		gin.SetMode(gin.ReleaseMode)
		wh.router = gin.Default()
	}
	if level > 1 {
		wh.router = gin.Default()
	}
	// bind the lease db
	wh.store = l
	// bind the config
	wh.config = c
	// bind the config to the file store
	wh.fs = c.fs

	// templates
	// base os selector
	t, err := template.New("list").Parse(OsSelector)
	if err != nil {
		logger.Critical("template error : %v", err)
		return nil
	}
	// class selector
	_, err = t.New("class").Parse(ClassSelector)
	if err != nil {
		logger.Critical("template error : %v", err)
		return nil
	}

	wh.templates = t
	// rocket handlers
	wh.RocketHandler()
	// chose and operating system
	wh.router.GET("/choose", wh.Lister)
	wh.router.GET("/choose/:dist/:mac", wh.Chooser)
	wh.router.GET("/class/:dist/:mac", wh.ClassChooser)
	wh.router.GET("/setclass/:dist/:class/:mac", wh.ClassSet)
	// get the boot line for your operating system
	wh.router.GET("/boot/:dist/:mac", wh.Starter)
	// load the kernel and file system
	wh.router.GET("/image/:dist/*path", wh.Images)
	// serve the bin folder
	wh.router.GET("/bin/*path", wh.Binaries)
	// actions for each distro
	wh.router.GET("/action/:dist/:action", wh.Action)
	// configs for each distro
	wh.router.GET("/config/:dist/:action", wh.Config)
	if wh.config.Spawn {
		wh.SpawnHandler()
	}
	return wh
}
Esempio n. 3
0
File: main.go Progetto: cch123/esweb
func init() {
	readConfig()
	if config.Environment.Env == "release" {
		gin.SetMode(gin.ReleaseMode)
	}
	if config.Environment.Env == "debug" {
		gin.SetMode(gin.DebugMode)
	}
	client = elasticsearch.NewClientFromUrl(config.Es_cluster.Addr)
}
Esempio n. 4
0
func SetMode(mode string) {
	switch mode {
	case "release":
		gin.SetMode(gin.ReleaseMode)
	case "debug":
		gin.SetMode(gin.DebugMode)
	case "test":
		gin.SetMode(gin.TestMode)
	default:
		panic("mode unavailable. (debug, release, test)")
	}
}
Esempio n. 5
0
func SetMode(value string) {
	switch value {
	case DevMode:
		gin.SetMode(gin.DebugMode)
	case ProdMode:
		gin.SetMode(gin.ReleaseMode)
	case TestMode:
		gin.SetMode(gin.TestMode)
	default:
		panic("mode unknown: " + value)
	}
	modeName = value
}
Esempio n. 6
0
func NewDaemon(port int, debug bool, dockerClient *dockerclient.DockerClient, dockerHost string, redisClient *redis.Client) *Daemon {
	if debug {
		logs.Debug.Println("Initializing daemon in debug mode")
		gin.SetMode(gin.DebugMode)
	} else {
		gin.SetMode(gin.ReleaseMode)
	}
	engine := gin.Default()
	cron := cron.New()
	intools.Engine = &intools.IntoolsEngineImpl{dockerClient, dockerHost, redisClient, cron}
	daemon := &Daemon{port, engine, debug}
	return daemon
}
Esempio n. 7
0
func main() {
	// Neo4J Database setup
	var db *neoism.Database
	if os.Getenv("NEO4J_HOST") != "" && os.Getenv("NEO4J_PORT") != "" {
		if connected, err := database.Connect(
			os.Getenv("NEO4J_USER"),
			os.Getenv("NEO4J_PASS"),
			os.Getenv("NEO4J_HOST"),
			os.Getenv("NEO4J_PORT"),
		); err != nil {
			log.Fatal(err)
		} else {
			db = connected
		}
	}

	// Postgres Database setup
	var pgdb *gorm.DB
	if connected, err := gorm.Open("postgres", "user=postgres dbname=newsapi sslmode=disable host=db"); err != nil {
		// if connected, err := gorm.Open("postgres", "user=newsapi dbname=newsapi sslmode=disable"); err != nil {
		log.Fatal(err)
	} else {
		pgdb = &connected
		pgdb.AutoMigrate(&models.User{})
	}

	// Setup analytics client
	var analytics *ga.Client
	if token := os.Getenv("ANALYTICS_TOKEN"); token == "" {
		fmt.Printf("Analytics token not provided.\n")
	} else if client, err := ga.NewClient(token); err != nil {
		log.Fatal(err)
	} else {
		fmt.Printf("Analytics activated.\n")
		analytics = client
	}

	// Setup environment
	if environment := os.Getenv("ENVIRONMENT"); environment == "PRODUCTION" {
		gin.SetMode(gin.ReleaseMode)
	} else {
		gin.SetMode(gin.DebugMode)
		if db != nil {
			db.Session.Log = true
		}
	}

	// Start
	Server(db, pgdb, analytics).Run(port)
}
func StartGin() {
	gin.SetMode(gin.ReleaseMode)

	router := gin.New()
	gin.Logger()
	router.Use(rateLimit, gin.Recovery())
	router.Use(gin.Logger())
	router.LoadHTMLGlob("resources/*.templ.html")
	router.Static("/static", "resources/static")
	router.GET("/", MyBenchLogger(), index)
	router.GET("/auth", authentication.RequireTokenAuthentication(), index)
	router.POST("/test", controllers.Login)
	router.GET("/room/:name", roomGET)
	router.POST("/room-post/:roomid", roomPOST)
	router.GET("/stream/:roomid", streamRoom)

	//mongodb user create
	uc := user_controllers.NewUserController(getSession())
	router.GET("/user", uc.GetUser)
	router.GET("/message", uc.GetMessage)
	router.POST("/message", uc.CreateMessage)
	router.POST("/user", uc.CreateUser)
	router.DELETE("/user/:id", uc.RemoveUser)

	router.Run(":5001")

}
Esempio n. 9
0
func main() {
	flag.Parse()

	common.Info("initializing metric http endpoint")
	connector, err := common.BuildRabbitMQConnector(*rabbitHost, *rabbitPort, *rabbitUser, *rabbitPassword, *rabbitExchange)
	if err != nil {
		log.Fatalln("error", err)
	}

	bindTo := fmt.Sprintf(":%d", *serverPort)

	common.Info("binding to:", bindTo)

	service := metricsService{connector: connector}

	gin.SetMode(gin.ReleaseMode)
	r := gin.New()
	r.Use(gin.Recovery())
	r.POST("/metrics", service.createMetric)
	r.GET("/debug/vars", expvar.Handler())

	if err := r.Run(bindTo); err != nil {
		log.Fatalln(err)
	}
}
Esempio n. 10
0
func serve() {
	if !Dev {
		gin.SetMode(gin.ReleaseMode)
	}
	r := gin.Default()
	r.NoRoute(handle404)

	r.Static("/assets", "./client/assets/")
	r.StaticFile("/bundle.js", "./client/bundle.js")

	// HTML5 Boilerplate
	r.StaticFile("/favicon.ico", "./client/assets/favicon.ico")
	r.StaticFile("/apple-touch-icon.png", "./client/assets/apple-touch-icon.png")
	r.StaticFile("/tile-wide.png", "./client/assets/tile-wide.png")
	r.StaticFile("/tile.png", "./client/assets/tile.png")
	r.StaticFile("/.htaccess", "./client/assets/.htaccess")
	r.StaticFile("/robots.txt", "./client/assets/robots.txt")
	r.StaticFile("/humans.txt", "./client/assets/humans.txt")
	r.StaticFile("/browserconfig.xml", "./client/assets/browserconfig.xml")
	r.StaticFile("/crossdomain.xml", "./client/assets/crossdomain.xml")

	r.LoadHTMLGlob("./client/templates/*")
	r.GET("/", func(c *gin.Context) {
		if Dev {
			r.LoadHTMLGlob("./client/templates/*")
		}
		obj := gin.H{"title": "Main Website"}
		c.HTML(http.StatusOK, "index.html", obj)
	})
	// Listen and serve on 0.0.0.0:Port
	r.Run(":" + strconv.Itoa(Port))
}
Esempio n. 11
0
func main() {
	gin.SetMode(gin.DebugMode)
	r := gin.New()

	r.GET("/:platform/*sourceurl", func(c *gin.Context) {
		platform := c.Params.ByName("platform")
		sourceurl := c.Params.ByName("sourceurl")[1:]

		v := url.Values{}
		var result string
		if platform == "sina" {
			v.Set("source", "")
			// v.Set("access_token", "")
			v.Set("url_long", sourceurl)
			log.Println(v.Encode())

			result = doPost(v.Encode(), "https://api.weibo.com/2/short_url/shorten.json")
		} else if platform == "baidu" {

		} else {
			result = platform + ": " + sourceurl
		}

		c.String(http.StatusOK, result)
	})

	r.Run(":8890")
}
Esempio n. 12
0
func main() {
	r.SetVerbose(true)

	defer utils.Recover()
	utils.ListenSignals()
	utils.Liveness()

	if os.Getenv("DEBUG_N") != "true" {
		gin.SetMode(gin.ReleaseMode)
	}

	engine := gin.New()

	engine.Use(gin.Recovery())
	engine.Use(func() gin.HandlerFunc {
		return func(c *gin.Context) {
			defer c.Next()
			log.Info(c.Request.Method, c.Request.URL.Path, c.Writer.Status())
		}
	}())

	api.Initialize(engine)

	engine.Run(config.Get(config.KEY_API_PORT))
}
Esempio n. 13
0
func init() {
	rand.Seed(time.Now().UTC().UnixNano()) // need to initialize the seed
	gin.SetMode(gin.ReleaseMode)

	// Removed some commands from here
	RootCmd.AddCommand(daedalusCmd)
}
func StartGin() {
	gin.SetMode(gin.ReleaseMode)
	r := gin.New()
	r.GET("/testApiPing", apiPing)
	r.GET("/testApiDB", apiDB)
	r.Run(":8082")
}
Esempio n. 15
0
// Listen Tells Gin API to start
func Listen(iface string, s *discordgo.Session, logger *logging.Logger) {
	// set the refs to point to main
	var v1 *gin.RouterGroup
	session = s
	c := config.Get()
	log = logger

	if c.LogLevel != "debug" {
		gin.SetMode(gin.ReleaseMode)
	}

	//r := gin.Default()
	r := gin.New()

	r.Use(loggerino())
	r.Use(gin.Recovery())

	if c.APIPassword != "" {
		log.Info("Basic Authentication enabled for API")
		v1 = r.Group("/v1", gin.BasicAuth(gin.Accounts{
			c.APIUsername: c.APIPassword,
		}))
	} else {
		log.Warning("DIGO_API_PASSWORD and DIGO_API_USERNAME are not set")
		log.Warning("The API is open to all requests")
		v1 = r.Group("/v1")
	}

	v1.GET("/version", versionV1)
	v1.GET("/channels", channelsV1)
	v1.POST("/message", messageV1)

	go r.Run(iface)
	log.Noticef("Digo API is listening on %s", c.APIInterface)
}
Esempio n. 16
0
func Init() {
	if router == nil {
		gin.SetMode(gin.TestMode)
		router = gin.Default()
		templ := template.New("index")
		router.SetHTMLTemplate(templ)
		store := sessions.NewCookieStore([]byte("foundation"))
		router.Use(sessions.Sessions("foundation", store))
		portNo := 0
		go func() {
			router.GET("/", func(c *gin.Context) {
				shared = *c
			})

			for portNo = 8124; true; portNo++ {

				addr := fmt.Sprintf(`:%d`, portNo)
				err := router.Run(addr)
				if err != nil {
					if strings.HasSuffix(err.Error(), `address already in use`) {
						continue
					}
				}

				break
			}

		}()
		time.Sleep(50 * time.Millisecond)
		http.Get(fmt.Sprintf("http://localhost:%d/", portNo)) // portNoが0じゃなくなるまでwaitしたほうが良い気もするが一旦
	}
}
Esempio n. 17
0
// NewGinEngineWithFaker allocate and returns a new gin.Engine pointer,
// added a new middleware which will check the type id param and the resource existence,
// if ok, set the float64 value of id named idFloat64, otherwise response 404 or 400.
func NewGinEngineWithFaker(faker *ApiFaker) *gin.Engine {
	engine := gin.Default()
	gin.SetMode(gin.ReleaseMode)
	// check id
	engine.Use(func(ctx *gin.Context) {
		// check if param "id" is int
		idStr := ctx.Param("id")
		if idStr == "" {
			return
		}

		id, err := strconv.ParseFloat(idStr, 64)
		if err != nil {
			ctx.JSON(http.StatusBadRequest, ResponseErrorMsg(err))
		}

		path := strings.TrimSuffix(ctx.Request.URL.Path, "/")
		pathPieces := strings.Split(path, "/")
		resourceName := pathPieces[len(pathPieces)-2]

		if router, ok := faker.Routers[resourceName]; ok {
			if _, ok := router.Model.Get(id); ok {
				ctx.Set("idFloat64", id)
			} else {
				ctx.JSON(http.StatusNotFound, nil)
			}
		}
	})

	return engine
}
Esempio n. 18
0
func main() {
	fmt.Println("Hello World!")
	DbaEnvrEx := buildEnvr()
	//#fmt.Print(DbaEnvrEx.ListTabl)

	var listData = make([]TITEM, 0)
	eror := DbaEnvrEx.SelectL(&listData, "select * from tbl_item")
	if eror != nil {
		fmt.Print(eror)
	}
	fmt.Print("readdata:", listData)

	count, _ := DbaEnvrEx.SelectD("select count(*) from tbl_item")
	fmt.Print("count", count)

	gin.SetMode(gin.DebugMode)
	r := gin.New()
	r.Use(CORSMiddleware())

	r.GET("/ping", func(c *gin.Context) {
		//#c.JSON(200, gin.H{"ERORCODE": "TRUE", "ERORMEMO": "APACHE BENCHMARK TESTING", "LISTDATA": "GOALNG"})
		var listData = make([]TITEM, 0)
		DbaEnvrEx.SelectL(&listData, "select * from tbl_item")
		c.JSON(200, listData)
	})

	r.Run(":9002")

}
Esempio n. 19
0
File: main.go Progetto: Depado/govue
func main() {
	var err error

	if err = conf.Load("conf.yml"); err != nil {
		log.Fatal(err)
	}

	// Database initialization
	if err = database.Main.Open(); err != nil {
		log.Fatal(err)
	}
	defer database.Main.Close()

	if !conf.C.Debug {
		gin.SetMode(gin.ReleaseMode)
	}
	r := gin.Default()
	r.Static("/static", "./assets")
	r.Static("/vendor", "./node_modules")

	r.GET("/", index)

	currentAPI := r.Group("/api/v" + strconv.Itoa(conf.C.APIVersion))
	entryEndpoint := currentAPI.Group("/entry")
	{
		entryEndpoint.POST("/", entry.Post)
		entryEndpoint.GET("/", entry.List)
		entryEndpoint.GET("/:id", entry.Get)
		entryEndpoint.PATCH("/:id", entry.Patch)
		entryEndpoint.DELETE("/:id", entry.Delete)
	}

	r.Run(fmt.Sprintf(":%s", strconv.Itoa(conf.C.Port)))
}
Esempio n. 20
0
func TestValidateParams(t *testing.T) {

	config.Settings.Limits.ParamMaxSize = 10

	gin.SetMode(gin.ReleaseMode)

	router := gin.New()

	// posts need to be verified
	router.Use(ValidateParams())

	router.GET("/index/:id", func(c *gin.Context) {
		c.String(200, "OK")
		return
	})

	first := performRequest(router, "GET", "/index/test")

	assert.Equal(t, first.Code, 400, "HTTP request code should match")

	second := performRequest(router, "GET", "/index/12")

	assert.Equal(t, second.Code, 400, "HTTP request code should match")

	third := performRequest(router, "GET", "/index/1")

	assert.Equal(t, third.Code, 200, "HTTP request code should match")

}
Esempio n. 21
0
//Sets gin to testing mode and presets the
//data storage to FakeDataStorage
//to emulate the database.
func preTest() (*gin.Engine, DataStorage) {
	gin.SetMode(gin.TestMode)
	oldMongo := mongo
	mongo = &FakeDataStorage{}
	router := gin.New()
	return router, oldMongo
}
Esempio n. 22
0
func (s *HandlersSuite) SetUpTest(c *C) {
	session, err := mgo.Dial("127.0.0.1:27017")
	c.Assert(err, IsNil)
	s.db = session.DB("unittest")
	gin.SetMode(gin.ReleaseMode)
	s.r = gin.Default()

	dbMiddleware := DatabaseMiddleware("127.0.0.1:27017", "unittest")
	s.r.POST("/logs", dbMiddleware, ReportHandler)
	s.r.GET("/logs", dbMiddleware, RetrieveHandler)

	logs := []Log{
		createLog(),
		createLog(),
		createLog(),
		createLog(),
		createLog(),
		createLog(),
	}

	for _, l := range logs {
		c.Assert(s.db.C("logs").Insert(l), IsNil)
	}

	go s.r.Run(":8769")
}
Esempio n. 23
0
func main() {

	//	nuCPU := runtime.NumCPU()
	//	runtime.GOMAXPROCS(nuCPU)
	//	fmt.Printf("Running with %d CPUs\n", nuCPU)

	if !configs.Debug {
		gin.SetMode(gin.ReleaseMode)
	}
	if configs.Debug {
		r.Use(gin.Logger())
	}
	r.Use(gin.Recovery())
	r.Static("/static", "./static")
	//	r.LoadHTMLGlob("templates/**/*.html")
	//	r.GET("/", indexPageHandler)
	r.GET("/", loginRequired(indexPageHandler))
	r.GET(login_page, loginHandler)
	r.POST(login_page, authLoginHandler)
	r.POST("/logout", logoutHandler)
	r.GET("/upload", loginRequired(upload))
	r.POST("/upload", loginRequired(upload))
	r.GET("/page/:link", pageRouter)
	r.NoRoute(func(c *gin.Context) {
		c.JSON(http.StatusNotFound, gin.H{"code": "PAGE_NOT_FOUND", "message": "Page not found"})
	})

	//	r.Run(":8080") // listen and serve on 0.0.0.0:8080

	http.ListenAndServe(":8080", CSRF(r))
	//	http.ListenAndServeTLS(":8080", "/etc/nginx/ssl/nginx.crt", "/etc/nginx/ssl/nginx.key", CSRF(r))
}
Esempio n. 24
0
File: main.go Progetto: jrudio/shart
func main() {
	config.Couchpotato.BuildURL()

	gin.SetMode(gin.ReleaseMode)

	// Start server
	router := gin.Default()

	router.GET("/couchpotato/:cmd", endpoint.cmdReply(config.Couchpotato))

	api := router.Group("/v1")
	{
		api.POST("/couchpotato", endpoint.parseMediaRequest(config.Couchpotato))
		// api.POST("/sonarr", parseMediaRequest(config.Sonarr))
		// api.POST("/plex", parseMediaRequest(config.Plex))
	}

	log.WithField("host", config.Shart.Host).Info("listening for connections...")

	// Start up server to listen for commands coming from Slack
	routerErr := router.Run(config.Shart.Host)

	if routerErr != nil {
		log.Fatal(routerErr)
	}
}
Esempio n. 25
0
func route() {
	// If we're in production mode don't run gin in develop
	if *production {
		gin.SetMode(gin.ReleaseMode)
	}

	// Create new router
	router = gin.Default()

	// Compile html templates
	router.LoadHTMLGlob("app/html/*.html")

	// Add all routes
	addRoutes()

	// Add static routes
	router.Static("/", "./public/")

	// Create http server based off of net/http
	addr := fmt.Sprintf("%s:%d", *host, *port)
	s := &http.Server{
		Addr:           addr,
		Handler:        router,
		ReadTimeout:    10 * time.Second,
		WriteTimeout:   10 * time.Second,
		MaxHeaderBytes: 1 << 20,
	}

	// Log
	log.Fatal(s.ListenAndServe())
}
Esempio n. 26
0
func main() {
	gin.SetMode(gin.ReleaseMode)

	var (
		r            = gin.Default()
		addr         = getenv("MOLE_ADDR", ":8080")
		cert         = os.Getenv("MOLE_CERT")
		key          = os.Getenv("MOLE_KEY")
		mongoAddr    = getenv("MOLE_MONGO_ADDR", "127.0.0.1:27017")
		dbName       = getenv("MOLE_DB_NAME", "mole")
		dbMiddleware = mole.DatabaseMiddleware(mongoAddr, dbName)
	)

	r.Use(cors.Middleware(cors.Config{
		Origins:         "*",
		Methods:         "PUT, POST",
		RequestHeaders:  "Origin, Authorization, Content-Type",
		ExposedHeaders:  "",
		MaxAge:          50 * time.Second,
		Credentials:     false,
		ValidateHeaders: false,
	}))

	r.POST("/logs", dbMiddleware, mole.ReportHandler)
	r.GET("/logs", dbMiddleware, mole.RetrieveHandler)
	r.GET("/log/:id", dbMiddleware, mole.SingleLogHandler)

	if cert != "" && key != "" {
		r.RunTLS(addr, cert, key)
	} else {
		r.Run(addr)
	}
}
Esempio n. 27
0
func main() {
	gin.SetMode(gin.ReleaseMode)
	r := gin.Default()

	sigc := make(chan os.Signal, 1)
	signal.Notify(sigc, syscall.SIGHUP)
	go func() {
		<-sigc
		config = loadConfig(configFile)
		log.Println("config reloaded")
	}()

	config := loadConfig("config.json")

	r.POST("/", func(c *gin.Context) {
		var json Webhook
		if c.BindJSON(&json) == nil {
			processWebhook(json)
			c.String(http.StatusOK, "Ok.")
		} else {
			c.String(401, "Nope.")
		}

	})
	address := config.Address + ":" + strconv.FormatInt(config.Port, 10)
	r.Run(address)
}
Esempio n. 28
0
func init() {
	gin.SetMode(gin.ReleaseMode)
	_, err := exec.Command("cp", []string{"data/testdb.db.backup", "data/testdb.db"}...).Output()
	if err != nil {
		log.Fatal(err)
	}
}
Esempio n. 29
0
File: app.go Progetto: WnP/zut
func startApp(db *gorm.DB) {
	log := logging.MustGetLogger("log")

	if viper.GetString("logtype") != "debug" {
		gin.SetMode(gin.ReleaseMode)
	}
	g := gin.Default()
	//r := NewRessource(db)

	g.Use(cors.Middleware(cors.Config{
		Origins:         "*",
		Methods:         "GET, PUT, POST, DELETE",
		RequestHeaders:  "Origin, Authorization, Content-Type",
		ExposedHeaders:  "",
		MaxAge:          50 * time.Second,
		Credentials:     true,
		ValidateHeaders: false,
	}))

	g.Static("/", "./static")

	/*v1 := g.Group("api/v1")
	{
		v1.GET("/temperatures", r.GetTemperatures)
		v1.POST("/temperature", r.PostTemperature)
	}*/
	log.Debug("Port: %d", viper.GetInt("server.port"))
	g.Run(":" + strconv.Itoa(viper.GetInt("server.port")))
}
Esempio n. 30
0
func NewRouter() *gin.Engine {

	gin.SetMode(gin.ReleaseMode)

	router := gin.Default()
	router.RedirectTrailingSlash = true
	router.RedirectFixedPath = true

	router.Use(gzip.Gzip(gzip.DefaultCompression))
	router.Use(middleware.ContentTypeCheckerMiddleware())
	router.Use(middleware.RequestIdMiddleware())
	router.Use(middleware.RevisionMiddleware())

	router.Use(cors.Middleware(cors.Config{
		Origins:         "*",
		Methods:         "GET, PUT, POST, DELETE, PATCH, OPTIONS",
		RequestHeaders:  "Origin, Authorization, Content-Type",
		ExposedHeaders:  "",
		MaxAge:          1728000,
		Credentials:     true,
		ValidateHeaders: false,
	}))

	return router
}