Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(web): wire Extension API and enable DELETE CORS

Richie McIlroyfb036766cf10
diff --git a/apps/web/app/api/[[...route]]/route.ts b/apps/web/app/api/[[...route]]/route.ts
index e0e4bd773..8745d4ba0 100644
--- a/apps/web/app/api/[[...route]]/route.ts
+++ b/apps/web/app/api/[[...route]]/route.ts
@@ -9,5 +9,6 @@ const handler = apiToHandler(
export const GET = handler;
export const POST = handler;
+export const DELETE = handler;
export const HEAD = handler;
export const OPTIONS = handler;
diff --git a/apps/web/lib/server.ts b/apps/web/lib/server.ts
index 0e20a0db3..86b59486e 100644
--- a/apps/web/lib/server.ts
+++ b/apps/web/lib/server.ts
@@ -4,6 +4,7 @@ import { serverEnv } from "@cap/env";
import {
AwsCredentials,
Database,
+ Extensions,
Folders,
HttpAuthMiddlewareLive,
ImageUploads,
@@ -111,6 +112,7 @@ export const Dependencies = Layer.mergeAll(
VideosPolicy.Default,
VideosRepo.Default,
Tinybird.Default,
+ Extensions.Default,
Folders.Default,
SpacesPolicy.Default,
OrganisationsPolicy.Default,
@@ -162,7 +164,7 @@ export const runPromiseExit = <A, E>(
const cors = HttpApiBuilder.middlewareCors({
allowedOrigins,
credentials: true,
- allowedMethods: ["GET", "HEAD", "POST", "OPTIONS"],
+ allowedMethods: ["GET", "HEAD", "POST", "DELETE", "OPTIONS"],
allowedHeaders: ["Content-Type", "Authorization", "sentry-trace", "baggage"],
});