Next.js Discord

Discord Forum

Failed to parse URL /api/... on Next 15

Unanswered
Chien Français Blanc et Orange posted this in #help-forum
Open in Discord
Chien Français Blanc et OrangeOP
Hi guys, I'm having a problem trying to use the api route to fetch

// is working
const response = await fetch(
    `http://localhost:3000/api/events/verify-auth?eventid=${eventId}&dashauthkey=${authCode}`,
    { cache: 'no-store' },
)

// is not working
const response = await fetch(
    `/api/events/verify-auth?eventid=${eventId}&dashauthkey=${authCode}`,
    { cache: 'no-store' },
)


I'd love to use ‘/api/.../’ in this way, would that be possible?

0 Replies