title: Is it a bad idea to host a rest api on a cdn?
body: <p>I'm new to server architecture and have been reading around a lot but have not yet had a solid opinion on if the setup below is good practice or not and was hoping someone with more experienced can give me confirmation if I'm setting up my architecture correctly:</p>
  
  <ul>
  <li>Use Angular Universal to Pre render html to CDN (e.g. Cloudflare)</li>
  <li>Cloudinary for Image assets</li>
  <li>One/Few strong machines with ngix handling bus load and sending off to other servers listed below (all hosted in digital ocean):
  
  <ul>
  <li>Rest API (Express Server)</li>
  <li>Database MongoDB</li>
  </ul></li>
  </ul>
  
  <p>I'm really concerned about the speed of my rest api as the regions offered in digital ocean seem significantly smaller in contrast to a cdn like cloudflare. <strong>How much does this matter when affecting my speed and is a service?</strong> </p>
  
  <p>I know this might sound ridiculous but the region issue makes me wonder if hosting a rest api express server on a cdn would be better than a place like digital ocean. (my instincts tell me I should't do this on a cdn but am at a loss for reasons and hope someone can provide clear reasons why I can or shouldn't host an express rest api server there.)</p>