title: Play 2 modules: how to add routes without tight coupling?
body: <p>I am developing a <a href="http://www.playframework.org/" rel="nofollow">Play 2</a> <a href="http://www.playframework.org/documentation/2.0.2/Modules" rel="nofollow">module</a> that exposes some URLs and am wondering how I can "offer" these URLs to the Play application that is hosting my module.</p>
  
  <p><strong>Example:</strong> Suppose my module (called <code>store</code>) realizes a document repository, offering (amongst others) the URL <code>document/&lt;id&gt;</code> to read the document with id <code>&lt;id&gt;</code>. Depending on its needs, the application that uses this module may expose this URL under <code>http://example.org/media/document/&lt;id&gt;</code>, or under <code>http://example.org/document/&lt;id&gt;</code>, or something else.</p>
  
  <p><strong>Question:</strong> How does a module expose URLs (routes) to its encompassing application without hardcoding them?</p>
  
  <p><em>Note:</em> I am coming from Django and was looking for a mechanism similar to <a href="https://docs.djangoproject.com/en/dev/intro/tutorial03/#decoupling-the-urlconfs" rel="nofollow">Django URLconfs</a>.</p>