configworker/main_test.go
2020-01-03 02:12:31 +08:00

21 lines
346 B
Go

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"))
}