Skip to content

Commit

Permalink
blog api
Browse files Browse the repository at this point in the history
  • Loading branch information
adnjoo committed May 29, 2024
1 parent 1af9984 commit 0d9e904
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/app/(api)/api/blog/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { NextResponse } from 'next/server';
import { getPosts } from '@/app/blog/functions';

export async function GET() {
const posts = await getPosts();
const count = posts.length;

return NextResponse.json({
meta: {
count,
},
posts,
});
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Songs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Link from 'next/link';

async function getLikedSongs() {
try {
const response = await fetch(process.env.URL + '/soundcloud', {
const response = await fetch(process.env.URL + '/api/soundcloud', {
cache: 'no-store',
});
const data = await response.json();
Expand Down

0 comments on commit 0d9e904

Please sign in to comment.