-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Closed
Milestone
Description
Bug report
Describe the bug
You get a 500 with code in /pages/api/index.js but not if you put the same code in /pages/api/foo.js
To Reproduce
Put the following code in /pages/api/index.js:
export default (req, res) => {
res.setHeader('Content-Type', 'application/json');
res.statusCode = 200;
res.end(JSON.stringify({ name: 'Nextjs' }));
};Deploy to Now, and go to deployment.endpoint/api, you'll get a 500 (complaining that res.setHeader is not a function).
Hope I'm not missing something. Cheers!
Reactions are currently unavailable