route.ts

src/app/api/share-count/route.ts
import { NextRequest, NextResponse } from 'next/server'
import blogData from '@/../_data/_blog.json'
import {
getShareCount,
getShareCounts,
recordShareIntent,
} from '@/utils/blog-shares'
import { shareTargets } from '@/utils/share-targets'
export const dynamic = 'force-dynamic'
const validTargets = new Set(shareTargets.map((t) => t.id))
function findPost(slug: string) {
return (blogData as { id: number; slug: string }[]).find(
(p) => p.slug === slug
)
}
export async function GET(request: NextRequest) {

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC