configworker/main_test.go

21 lines
346 B
Go
Raw Normal View History

2020-01-02 18:12:31 +00:00
package main
import (
"log"
"testing"
"github.com/gin-contrib/sessions"
"github.com/gin-contrib/sessions/cookie"
"github.com/gin-gonic/gin"
)
func TestMain(t *testing.T) {
eg := gin.New()
eg.Use(sessions.Sessions(SessionUser, cookie.NewStore([]byte("yame"))))
eg.Use(auth)
eg.POST("/api/login", login)
log.Fatal(eg.Run(":3001"))
}