-
SummaryBasically says it on the tin, but I have the file /pages/api/hello.js It works perfectly on localhost, showing "Hello" as JSON in the browser... But after deploying, the same path throws a 404 error. Nothing in the logs either. Examplehttps://stellarr-45y3k9c5i-vitalize-digital.vercel.app/api/hello (latest deployment at the time of writing) https://github.com/adomakins/stellarr (link to my public repo so you can see what it looks like) Steps to ReproduceYou can reproduce this problem by:
// /pages/api/hello.js
export default async function handler(req, res) {
console.log(`New event received`);
res.status(200).json({ text: 'Hello' });
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi @adomakins, I don't have access to that URL unfortunately. But can you check your Build Settings? See relevant documentation. |
Beta Was this translation helpful? Give feedback.
Okay thank you! So I checked that out, changed the framework preset to Next.js, AND IT WORKED!