Answer the question
In order to leave comments, you need to log in
PHP API & Next.js?
Can you please tell me if it's okay to combine API written in PHP with Next.js?
I need SSR, I'm considering 2 options:
1. Write an API in PHP using Next.js for the front application rendering layer.
2. Embed some Express.js into Next.js (custom server) (but for me personally, working with Node is difficult).
I specialize in PHP (Symfony) myself, and would like to write an API in it, but I'm not entirely sure how correct it is to combine PHP with Next.js. As I understand it, getInitialProps() - will just access the API on the puff?
Maybe someone has already written a similar project, or there is an open source example, please discard)
Answer the question
In order to leave comments, you need to log in
next.js supports API routes out of the box.
https://nextjs.org/docs/api-routes/introduction
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question