summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-01-31 15:53:50 -0200
committerdrebs <drebs@leap.se>2013-01-31 15:53:50 -0200
commit193b018842bd1c9460e77363338f057fcb22a390 (patch)
tree5465668518f91b6c2ebc363029f8aedc4f2a8db7
parent7331249a6814eac085d5bbdb1e842614a0130917 (diff)
Add basic Soledad server with no support for new backends yet.
-rw-r--r--server.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/server.py b/server.py
new file mode 100644
index 00000000..708e2e8c
--- /dev/null
+++ b/server.py
@@ -0,0 +1,22 @@
+"""
+An 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,
+ server_state,
+)
+
+state = server_state.ServerState()
+# 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)