Next.JS: How to make ALL requests server-side

后端 未结 3 1688
星月不相逢
星月不相逢 2021-02-02 02:45

I am building a Next.JS app that will be getting data from a Python API and an Postgres Database.

Normally this would be simple, except requirements are such that I need

3条回答
  •  名媛妹妹
    2021-02-02 03:42

    This is generally a bad idea.

    The entire point of an SPA is to prevent full page loads.

    You can use getInitialProps to fetch stuff while on the initial page request, and on subsequent navigations, as it is called for every page.

    Next is encouraging you to use an API to talk to the server

提交回复
热议问题