Skip to content

How to set up NextJS + API Server on Vercel #10

Answered by aeneasr
bryanveloso asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you for the explanation! So there are a few layers to this:

  1. You are running an API server at a subdomain or the same domain. I strongly want to discourage you from using a third top level domain (e.g. notalatir.tv) because you will run into tons of issues with CORS, and in particular cookies as all browsers are cracking down on third-party (which would be the case here) cookies.
  2. You are running the UI on Vercel
  3. You have previews of the UI on Vercel

So in general you want to protect your API server from unauthorized access. The easiest way to do that is to use the Ory Proxy. Here, you can follow two patterns:

  1. Run the proxy in a docker container "in front of" your API server so that

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@aeneasr
Comment options

@bryanveloso
Comment options

@aeneasr
Comment options

Answer selected by vinckr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants