feat: update API endpoints and enhance feed retrieval logic, add CORS support

This commit is contained in:
2025-09-05 22:26:39 +02:00
parent 0e6c072387
commit d70015c887
6 changed files with 14 additions and 7 deletions

View File

@@ -23,7 +23,7 @@ export default function Home() {
const fetchFeed = async () => {
try {
setError(null);
const response = await fetch("http://localhost:8000/api/feed");
const response = await fetch("http://localhost:8000/feed");
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
@@ -51,7 +51,7 @@ export default function Home() {
if (!newThoughtContent.trim()) return; // Prevent empty posts
try {
const response = await fetch("http://localhost:8000/api/thoughts", {
const response = await fetch("http://localhost:8000/thoughts", {
method: "POST",
headers: {
"Content-Type": "application/json",