Next.js Discord

Discord Forum

Using app router but API still in pages

Answered
Mossyrose gall wasp posted this in #help-forum
Open in Discord
Mossyrose gall waspOP
Hi, I am using the app router for my website put still using the pages directory for two API's. Locally this works ok but when trying to access the one API in preview or production I get a 500 error.

So was just wondering, if using the app router, is it ok to have API's in the pages directory?
Answered by American black bear
you can use both simultaneously
View full answer

5 Replies

American black bear
you can use both simultaneously
Answer
Mossyrose gall waspOP
Cheers, I thought that might be the case but my one API wasn't working, I guess that's down to the individual API, cheers for the confirmation.
Mossyrose gall waspOP
Got this working now thanks.