~loggerhead-team/loggerhead/trunk-rich

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
import sys

from paste import httpserver
from paste.httpexceptions import HTTPExceptionHandler
from paste.translogger import TransLogger

from loggerhead.apps.filesystem import BranchesFromFileSystemRoot

if len(sys.argv) > 1:
    path = sys.argv[1]
else:
    path = '.'

app = BranchesFromFileSystemRoot(path)

app = HTTPExceptionHandler(app)
app = TransLogger(app)

try:
    from paste.deploy.config import PrefixMiddleware
except ImportError:
    pass
else:
    app = PrefixMiddleware(app)

#from paste.evalexception import EvalException
#app = EvalException(app)

httpserver.serve(app, host='0.0.0.0', port='8080')