RootΒΆ

The root argument is the name of the directory containing all your sources.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import zunzuncito

root = 'my_api'

versions = ['v0', 'v1']

hosts = {'*': 'default'}

routes = {'default':[
    ('/(md5|sha1|sha256|sha512)(/.*)?', 'hasher', 'GET, POST'),
    ('/(.*\.(gif|png|jpg|ico|bmp|css|otf|eot|svg|ttf|woff))', 'static')
]}

app = zunzuncito.ZunZun(root, versions, hosts, routes)

Making an analogy, you can see root as the DocumentRoot of the application.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/home/
  `--zunzun/
     |--app.py
     `--my_api
       |--__init__.py
       `--default
          |--__init__.py
          |--v0
          |  |--__init__.py
          |  |--zun_default
          |  |  |--__init__.py
          |  |  `--zun_default.py
          |  `--zun_hasher
          |     |--__init__.py
          |     `--zun_hasher.py
          `--v1
             |--__init__.py
             |--zun_default
             |  |--__init__.py
             |  `--zun_default.py
             `--zun_hasher
                |--__init__.py
                `--zun_hasher.py
  • In this case the my_api directory, is the root

Many thanks Paw - The ultimate REST client for Mac. for supporting Open Source projects.

paw

A great amount of time has been spent creating, crafting and maintaining this software, please consider donating.

Donating helps ensure continued support, development and availability.

dalmp


comments powered by Disqus