init commit

This commit is contained in:
sentriz
2019-03-24 17:49:03 +00:00
commit e9c0f09d0c
527 changed files with 477627 additions and 0 deletions

31
router/router.go Normal file
View File

@@ -0,0 +1,31 @@
package router
import (
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
)
// New creates a new Echo instance
func New() *echo.Echo {
e := echo.New()
e.HideBanner = true
e.Pre(middleware.RemoveTrailingSlash())
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
AllowOrigins: []string{"*"},
AllowHeaders: []string{
echo.HeaderOrigin,
echo.HeaderContentType,
echo.HeaderAccept,
echo.HeaderAuthorization,
},
AllowMethods: []string{
echo.GET,
echo.HEAD,
echo.PUT,
echo.PATCH,
echo.POST,
echo.DELETE,
},
}))
return e
}