~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to Code_python/DocServer/Solutions/solution_zmq_doc_http_server/zmq_doc_http_server/__init__.py

  • Committer: Dave Kuhlman
  • Date: 2015-10-09 19:50:18 UTC
  • mfrom: (35.1.6 Materials)
  • Revision ID: dkuhlman@davekuhlman.org-20151009195018-8rfrdur2zxdjn5ds
Merge after training at Cisco 10/05/2015

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from pyramid.config import Configurator
 
2
 
 
3
 
 
4
def main(global_config, **settings):
 
5
    """ This function returns a Pyramid WSGI application.
 
6
    """
 
7
    config = Configurator(settings=settings)
 
8
    config.include('pyramid_chameleon')
 
9
    config.add_static_view('static', 'static', cache_max_age=3600)
 
10
 
 
11
    config.add_route('help_view', '/')
 
12
    config.add_route('list_view', '/list')
 
13
    config.add_route('get_view', '/get/{doc_id}')
 
14
    config.add_route('search_view', '/search/{tag}')
 
15
 
 
16
    config.scan()
 
17
    return config.make_wsgi_app()