I know this is subjective and opinionated, but I just need something to start off from knowing what the best practices may be.
I've got a MERN application running on localhost with the React script currently running on port 3000 and an Express.js application running on port 3001.
Now I'm about to set it up live on AWS and am wondering if I should create it like:
website.com
for the frontend React stuff with nginx routing anything from port 80 to 3000 while it makes calls to api.website.com
running on 3001 on the same instance with website.com
and `api.website.com having the same IP address.
or
one separate instance for website.com on a different IP address and another instance for api.website.com
on a different IP address for API calls? Both are being accessed without having to specify a port.
I'm curious because most of the time I've used APIs, they don't have a separate port, just a subdomain on what I assume was a different IP address and a different instance.
What would be the best way to set this up keeping in mind I want to use SSL?