title: Allowing cross-domain calls with Yeoman (1.0) grunt server
body: <p>I've been using Yeoman 0.9 up until yesterday when I decided to use the beta 1.0 release on OS X. I use Yeoman to develop an angular app.</p>
  
  <p>With the Yeoman 0.9-->1.0 migration of my app done and working, I'm now keen to extend the dev server fired up by <strong><del>yeoman</del> grunt server</strong> to allow me to make cross-domain calls to an API developed by another team, hosted on another server, where they've already allowed cross-domain calls. Up to now we've been using a fake http backend courtesy of angular.js.</p>
  
  <p><strong>--An aside--</strong></p>
  
  <p>If anyone's reading this looking for a quick solution, we got cross-domain calls working by passing the <strong><em>--disable-web-security</em></strong> option to Chrome from the command line using <a href="http://cweagans.net/blog/2011/1/24/command-line-flags-google-chrome-mac-osx" rel="nofollow noreferrer">this approach</a> on OS X with Chrome, but it turns off security for all of Chrome (thumbs down) and we can't get Chrome to fire up as a new instance anyway.</p>
  
  <p><strong>--End aside--</strong></p>
  
  <p>Through some digging I found <a href="https://stackoverflow.com/questions/7067966/how-to-allow-cors-in-express-nodejs/7069902#7069902">this Stack Overflow post</a> (via the answer to <a href="https://stackoverflow.com/questions/14617111/yeoman-how-to-set-headers-htaccess">this post</a>) giving me a pretty good idea on what I need to do to get <strong><em>grunt server</em></strong> allowing cross-domain calls. 
  It essentially involves adding a middleware component to connect to allow alter the headers so that "Access-Control-Allow-Origin" is set to "*" or whatever one likes. </p>
  
  <p>Knowing nothing about Node.js, I can see the change alluded to in the post needs to be made somewhere in the many files created by Yeoman, but where? I've done some raw string searches for "app.configure" and "connect.listen" within the "node_modules" directory set up by Yeoman but I come up with a number of hits, most of which are from examples bundled with the modules and it isn't clear to me which I should edit. In case it helps, here's a snapshot of the directory structure for my angular app:</p>
  
  <p><img src="https://i.stack.imgur.com/T3Ubt.png" alt="enter image description here"> </p>
  
  <p>If anyone can give me some pointers on where these changes may be made I'd really appreciate it!</p>