feat: server tests (#1556)

* feat: server tests

* chore: update
This commit is contained in:
boojack
2023-04-17 21:34:59 +08:00
committed by GitHub
parent e62a94c05a
commit 994d5dd891
7 changed files with 442 additions and 7 deletions

View File

@ -53,11 +53,6 @@ func NewServer(ctx context.Context, profile *profile.Profile) (*Server, error) {
e.Use(middleware.Gzip())
e.Use(middleware.CSRFWithConfig(middleware.CSRFConfig{
Skipper: s.defaultAuthSkipper,
TokenLookup: "cookie:_csrf",
}))
e.Use(middleware.CORS())
e.Use(middleware.SecureWithConfig(middleware.SecureConfig{
@ -141,6 +136,10 @@ func (s *Server) Shutdown(ctx context.Context) {
fmt.Printf("memos stopped properly\n")
}
func (s *Server) GetEcho() *echo.Echo {
return s.e
}
func (s *Server) createServerStartActivity(ctx context.Context) error {
payload := api.ActivityServerStartPayload{
ServerID: s.ID,