A
A
ADA M2020-02-10 10:10:40
API
ADA M, 2020-02-10 10:10:40

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

1 answer(s)
M
Mikhail Osher, 2020-02-10
@adiletmurzaliev

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 question

Ask a Question

731 491 924 answers to any question