If you want to deploy server(full) with support fo...
# orm-help
l
If you want to deploy server(full) with support for connection pooling, what’s the go to with the best developer experience? Digital Ocean? RDS? I want to deploy a Prisma + Postgres database I can use with Next.js + next-auth.
j
Both DO and Heroku have nice PgBouncer offerings that just work (confirmed via e2e tests on our side 😄 ).
👍 3
a
Easy UI DO, otherwise I'd recommend Linode for more refined control in a programmatic way
p
@Lee Robinson what's your experience with next-auth? We've been using auth0 with nextjs and it's becoming problematic to switch to the new getStaticProps as you can imagine. These are pages that are not public, but they should render exactly the same for all authenticated users, while unauthenticated ones get redirected to login screen (maybe just render a page with
router.replace()
) But getStaticProps does not have the context as its rendered outside of the scope of who is asking for it. I'd really like to move from SSR to SSG
l
I haven’t built anything with next-auth yet, which is partially why I asked. Curious to try it out, specifically with Prisma! Sounds like you’re looking for SSR + CSR, where the initial markup comes from the server (loading shell) and then you have user checks on the client side.
p
yep exactly
l
I’m currently using that setup for a product I’m building, but it’s with Firebase. Missing the redirects right now but this could help https://github.com/leerob/fastfeedback/blob/master/pages/feedback.js
p
but right now the initial markup is a spinner as the components render that when loading the user data
l
Why not fetch the user data on the server?
p
sorry was afk.
Why not fetch the user data on the server?
That is exactly what I am trying to do, but I need the
authorization
header to be captured and
getStaticProps
does not expose the headers (as it is obviously not running at runtime with an actual user, but generated beforehand)
l
No, I’m saying with
getServerSideProps
. Why not fetch the user data on the sever and not have a client side loading state?
Since you mentioned that you’re currently doing SSR but also have a client side loading spinner.