Commit 0f9085ef authored by Jacek Furmankiewicz's avatar Jacek Furmankiewicz

setup.py

parent c24140fa
...@@ -7,7 +7,7 @@ Provides a more Flask/Sinatra-style API on top of the core *twisted.web* APIs. ...@@ -7,7 +7,7 @@ Provides a more Flask/Sinatra-style API on top of the core *twisted.web* APIs.
Geared towards creating REST-oriented server platforms (e.g. as a source of data for a Javascript MVC app). Geared towards creating REST-oriented server platforms (e.g. as a source of data for a Javascript MVC app).
Tested exclusively on PyPy for maximum performance. Tested exclusively on PyPy for maximum performance.
Example: Example
------- -------
from corepost.server import CorePost from corepost.server import CorePost
...@@ -16,11 +16,11 @@ Example: ...@@ -16,11 +16,11 @@ Example:
app = CorePost() app = CorePost()
@app.route("/",Http.GET) @app.route("/",Http.GET)
def root(request): def root(request,**kwargs):
return request.path return request.path
@app.route("/test",Http.GET) @app.route("/test",Http.GET)
def test(request): def test(request,**kwargs):
return request.path return request.path
@app.route("/test/<int:numericid>/test2/<stringid>",Http.GET) @app.route("/test/<int:numericid>/test2/<stringid>",Http.GET)
...@@ -37,7 +37,7 @@ If you want a deferred async method, just complete the request yourself, instead ...@@ -37,7 +37,7 @@ If you want a deferred async method, just complete the request yourself, instead
@app.route("/",Http.GET) @app.route("/",Http.GET)
@defer.inlineCallbacks @defer.inlineCallbacks
def root(request): def root(request,**kwargs):
val = yield db.query("SELECT ....") val = yield db.query("SELECT ....")
request.write(val) request.write(val)
request.finish() request.finish()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment