Yucheng
02/14/2021, 2:16 AMEddy Nguyen
02/14/2021, 3:13 AMgetServerSideProps
is only ever run on the server: https://nextjs.org/docs/basic-features/data-fetching#only-runs-on-server-side
So I think in this case, it should be ok 🙂 . Did you encounter a case where getServerSideProps
is run on the client?Ryan
02/15/2021, 5:46 AMgetServerSideProps
is never run on the client so you do not need to worry about your database being exposed to the frontend.Yucheng
02/15/2021, 6:10 PM