Skip to content

Commit 0ccab6c

Browse files
committed
updated
1 parent 1218dee commit 0ccab6c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

next.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ const nextConfig = {
1111
},
1212
];
1313
},
14+
async headers() {
15+
return [
16+
{
17+
source: "/api/:path*",
18+
headers: [
19+
{ key: "Access-Control-Allow-Credentials", value: "true" },
20+
{ key: "Access-Control-Allow-Origin", value: "*" },
21+
{ key: "Access-Control-Allow-Methods", value: "GET,OPTIONS,PATCH,DELETE,POST,PUT" },
22+
{ key: "Access-Control-Allow-Headers", value: "X-Requested-With, Accept, Content-Type, Authorization" },
23+
],
24+
},
25+
];
26+
},
1427
};
1528

1629
module.exports = nextConfig;

src/app/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import TodoForm from "@/components/TodoForm";
44
import TodoItem from "@/components/TodoItem";
55
import { useStore } from "@/store";
6-
import Link from "next/link";
76
import { useEffect } from "react";
87

98
const Home: React.FC = () => {
@@ -18,7 +17,6 @@ const Home: React.FC = () => {
1817
<div className="container mx-auto max-w-md p-4">
1918
<TodoForm />
2019
<h1 className="text-2xl font-bold mb-4">Todo List</h1>
21-
<Link href="/api/python">Visit Python</Link>
2220
{todos.length === 0 ? (
2321
<p className="text-center">No Todos Found</p>
2422
) : (

0 commit comments

Comments
 (0)