I'm making an api that js clients will connect to. At the moment, I'm trying to figure out the best way to host the two things. I'm thinking of a few options. Which do you guys think could be best? 1. Serving both the client and backend from the same server. Client will be on sub.mydomain.tld and api will have routes at sub.mydomain.tld/api. 2. Client and backend served on separate places. Client uses sub.mydomain.tld/ and backend uses api.sub.mydomain.tld/ Are there other options I should consider as well?
1. Every time. Doesn't need to be the same server. But the urls should be the same domain.