source: cows/trunk/cows/pylons/project_templates/cows_server/+package+/config/routing.py @ 4917

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/trunk/cows/pylons/project_templates/cows_server/+package+/config/routing.py@4917
Revision 4917, 1.2 KB checked in by spascoe, 12 years ago (diff)

Created a Paste project template based on Dom's example server. This
was constructed by following the tutorial at
 http://pylonsbook.com/alpha1/simplesite_part_3 "Making SimpleSite? into a
Paste Project Template"

Line 
1"""Routes configuration
2
3The more specific and detailed routes should be defined first so they
4may take precedent over the more generic routes. For more information
5refer to the routes manual at http://routes.groovie.org/docs/
6"""
7from pylons import config
8from routes import Mapper
9
10def make_map():
11    """Create, configure and return the routes Mapper"""
12    map = Mapper(directory=config['pylons.paths']['controllers'],
13                 always_scan=config['debug'])
14
15    # The ErrorController route (handles 404/500 error pages); it should
16    # likely stay at the top, ensuring it can always be resolved
17    map.connect('error/:action/:id', controller='error')
18
19    # CUSTOM ROUTES HERE
20    map.connect(':fileoruri/wms', controller='csmlwms')
21    map.connect(':fileoruri/wcs', controller='csmlwcs')
22    map.connect(':fileoruri/wfs', controller='csmlwfs')
23    #filestore - used for fetching files referenced by (csml) StorageDescriptors (WFS), and  'store' in wcs if implemented
24    map.connect('filestore/:file', controller='fetch', action='fetchFile')
25
26
27    map.connect(':controller/:action/:id')
28    map.connect('*url', controller='template', action='view')
29
30    return map
Note: See TracBrowser for help on using the repository browser.