最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Does Next.js Needs a Node Server Running? - Stack Overflow

programmeradmin0浏览0评论

How does Next.js SSR working exactly.

If I don't care SEO at all then I can use React right? What if i care about SEO and don't want/need a node.js server in my background.

I have an API written in PHP. I tried in my local server to send requests from Next app to PHP Backend. In a real application do i have to create a Node.js backend in my server or is it enough to install Node and Npm only to install Next and it's dependencies?

How does Next.js SSR working exactly.

If I don't care SEO at all then I can use React right? What if i care about SEO and don't want/need a node.js server in my background.

I have an API written in PHP. I tried in my local server to send requests from Next app to PHP Backend. In a real application do i have to create a Node.js backend in my server or is it enough to install Node and Npm only to install Next and it's dependencies?

Share Improve this question edited Aug 30, 2021 at 17:31 Doğukan Akkaya asked Apr 21, 2020 at 16:24 Doğukan AkkayaDoğukan Akkaya 5031 gold badge3 silver badges13 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 16

Any page that uses getServerSideProps, Next.js converts that page to a lambda function. You don't need a node server running 24/7 for hosting your application.

Also, if you don't use getServerSideProps, Next.js by default will pre-render your page, this page gets cached on a CDN.

So yes you can make API calls to your PHP backend, without the need for a setting up a nodejs server yourself.

Hope that answers your question.

Thanks

发布评论

评论列表(0)

  1. 暂无评论