This commit is contained in:
cubixle
2022-03-22 20:02:23 +00:00
parent 83bb4268b0
commit 97115363fb

10
main.go
View File

@@ -15,6 +15,7 @@ import (
"time" "time"
"github.com/labstack/echo/v4" "github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
) )
// Item holds the data. // Item holds the data.
@@ -31,8 +32,6 @@ type Vault struct {
} }
func main() { func main() {
// binding.Validator = new(DefaultValidator)
router := echo.New()
appURL := os.Getenv("VAULT_APP_URL") appURL := os.Getenv("VAULT_APP_URL")
if appURL == "" { if appURL == "" {
@@ -44,11 +43,14 @@ func main() {
port = "8080" port = "8080"
} }
router := echo.New()
router.POST("/", createAction) router.POST("/", createAction)
router.POST("/decrypt", decryptAction) router.POST("/decrypt", decryptAction)
//router.Use(CORS(appURL)) router.Use(middleware.CORSWithConfig(middleware.CORSConfig{
//router.Use(Logger()) AllowOrigins: []string{appURL},
}))
if err := router.Start(":" + port); err != nil { if err := router.Start(":" + port); err != nil {
log.Fatal(err) log.Fatal(err)