Feat v0.9.0 multi surface packages (#73)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / test-frontend (push) Successful in 5s
CI/CD / test-go-pg (push) Successful in 2m46s
CI/CD / test-sqlite (push) Successful in 2m57s
CI/CD / build-and-deploy (push) Successful in 44s
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / test-frontend (push) Successful in 5s
CI/CD / test-go-pg (push) Successful in 2m46s
CI/CD / test-sqlite (push) Successful in 2m57s
CI/CD / build-and-deploy (push) Successful in 44s
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #73.
This commit is contained in:
@@ -958,12 +958,16 @@ func main() {
|
||||
Session: middleware.OptionalAuth(cfg, stores.Users, userCache),
|
||||
})
|
||||
|
||||
// Mounted at /s/:slug/api/* with JWT auth (returns 401, not redirect).
|
||||
// Extension surface + API routes: /s/:slug/* dispatches between
|
||||
// surface rendering (GET) and ext API calls (all methods, /api/* prefix).
|
||||
{
|
||||
extAPIH := handlers.NewExtAPIHandler(stores, starlarkRunner)
|
||||
extAPI := base.Group("/s/:slug/api")
|
||||
extAPI.Use(middleware.Auth(cfg, stores.Users, userCache, stores.APITokens))
|
||||
extAPI.Any("/*path", extAPIH.Handle)
|
||||
pageEngine.RegisterExtensionRoutes(
|
||||
base,
|
||||
middleware.OptionalAuth(cfg, stores.Users, userCache),
|
||||
middleware.Auth(cfg, stores.Users, userCache, stores.APITokens),
|
||||
extAPIH.Handle,
|
||||
)
|
||||
}
|
||||
|
||||
bp := cfg.BasePath
|
||||
|
||||
Reference in New Issue
Block a user