Skip to content

Commit 666880a

Browse files
authored
all set
1 parent ffa9374 commit 666880a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/app/api/indexnow/route.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { NextResponse } from "next/server";
2+
13
// Replace with your actual API key and URL
24
const apiKey = '11bf36c257104618b69465f71c342d6c';
35
let urlToSubmit = 'https://sh20raj.com/anishamalde/a-love-letter-to-gen-z-from-gen-y-understanding-reacts-evolution-4abm';
@@ -54,9 +56,16 @@ fetch('https://api.indexnow.org/IndexNow', {
5456
// Make an HTTP POST request to the IndexNow API
5557

5658

57-
58-
return Response.json({msg:"submitted",indexdata: await indexit(),host : host, apiKey: apiKey,keyLocation: keyLocation, url: urlToSubmit})
59-
59+
let result = {msg:"submitted",indexdata: await indexit(),host : host, apiKey: apiKey,keyLocation: keyLocation, url: urlToSubmit};
60+
// return Response.json()
61+
return new NextResponse(result, {
62+
status: 200,
63+
headers: {
64+
'Access-Control-Allow-Origin': '*',
65+
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
66+
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
67+
}
68+
});
6069

6170
}
6271

0 commit comments

Comments
 (0)