~coreygoldberg/uci-engine/subunit-results

« back to all changes in this revision

Viewing changes to subunit-results/subunitresults/__init__.py

  • Committer: Corey Goldberg
  • Date: 2014-08-18 15:30:49 UTC
  • Revision ID: corey.goldberg@canonical.com-20140818153049-xi6m3e8x52x7onn3
queue qorker

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
17
 
18
 
# copy NFSS-like config here
 
18
from wsgiref.simple_server import make_server
 
19
from pyramid.config import Configurator
 
20
 
 
21
from subunitresults.api import v1 as api_v1
 
22
 
 
23
 
 
24
def make_wsgi_app():
 
25
    config = Configurator()
 
26
    # Instead of configuring all the routes here, we defer to the individual
 
27
    # API version. This allows us to easily add 'v2' in the future. The actual
 
28
    # routes are added in the 'configure_routes' callable.
 
29
    #
 
30
    # The root app is served at '/api/v1/' - note the trailing '/'.
 
31
    config.include(api_v1.configure_routes, route_prefix='/api/v1')
 
32
    config.scan()
 
33
    return config.make_wsgi_app()
 
34
 
 
35
 
 
36
app = make_wsgi_app()
 
37
 
 
38
 
 
39
if __name__ == '__main__':
 
40
    server = make_server('0.0.0.0', 8000, app)
 
41
    server.serve_forever()