create-kofi-stack 1.2.11 → 1.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2768,11 +2768,11 @@ export async function protectRoute(request: Request) {
|
|
|
2768
2768
|
}
|
|
2769
2769
|
`;
|
|
2770
2770
|
await writeFile(path12.join(appDir, "src/lib/arcjet.ts"), content);
|
|
2771
|
-
const
|
|
2771
|
+
const proxyContent = `import { NextResponse } from 'next/server'
|
|
2772
2772
|
import type { NextRequest } from 'next/server'
|
|
2773
2773
|
import { aj } from '@/lib/arcjet'
|
|
2774
2774
|
|
|
2775
|
-
export async function
|
|
2775
|
+
export async function proxy(request: NextRequest) {
|
|
2776
2776
|
// Only protect API routes
|
|
2777
2777
|
if (request.nextUrl.pathname.startsWith('/api')) {
|
|
2778
2778
|
const decision = await aj.protect(request)
|
|
@@ -2792,7 +2792,7 @@ export const config = {
|
|
|
2792
2792
|
matcher: '/api/:path*',
|
|
2793
2793
|
}
|
|
2794
2794
|
`;
|
|
2795
|
-
await writeFile(path12.join(appDir, "src/
|
|
2795
|
+
await writeFile(path12.join(appDir, "src/proxy.ts"), proxyContent);
|
|
2796
2796
|
}
|
|
2797
2797
|
async function generateUpstash(appDir) {
|
|
2798
2798
|
const content = `import { Ratelimit } from '@upstash/ratelimit'
|