refactor: impl part of grpcweb

This commit is contained in:
Steven
2023-09-17 19:20:03 +08:00
parent d5c1706e9c
commit 72ca4e74ee
20 changed files with 3325 additions and 26 deletions

View File

@ -7,6 +7,7 @@ import (
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/usememos/memos/common/util"
)
//go:embed dist
@ -43,3 +44,8 @@ func embedFrontend(e *echo.Echo) {
Filesystem: getFileSystem("dist/assets"),
}))
}
func defaultAPIRequestSkipper(c echo.Context) bool {
path := c.Request().URL.Path
return util.HasPrefixes(path, "/api", "/memos.api.v2")
}