summaryrefslogtreecommitdiff
path: root/server.py
blob: 9e43de9330e8b3cb6c4c2e89b6802e2625d2521a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""
A U1DB server that stores data using couchdb.

This should be run with:
    twistd -n web --wsgi=leap.soledad.server.application
"""

from twisted.web.wsgi import WSGIResource
from twisted.internet import reactor
from u1db.remote import http_app
from leap.soledad.backends.couch import CouchServerState

# TODO: change couch url accordingly
couch_url = 'http://localhost:5984'
state = CouchServerState(couch_url)
# TODO: change working dir to something meaningful
state.set_workingdir('/tmp')
# TODO: write a LeapHTTPApp that will use Couch as backend instead of SQLite
application = http_app.HTTPApp(state)

resource = WSGIResource(reactor, reactor.getThreadPool(), application)