corepost
corepost copied to clipboard
Inheritance of service urls
I am trying corepost. Looks great!
With the following code running, a call to http://0.0.0.0:8000/test results to status=404, body=URL '/test' not found. It should be: status = 200, body = /test ?
from corepost.web import route, RESTResource
from corepost.enums import Http
class OneService():
@route("/test")
def test(self,request,**kwargs):
return request.path
class OtherRESTService(OneService):
@route("/test2")
def root(self,request,**kwargs):
return request.path
if __name__ == '__main__':
app = RESTResource(services=(OtherRESTService(),))
app.run(8000)
not sure I get the point :-/
you would create duplicate URL handlers all over the place, no?
Could you give me a valid example of why this would be useful?
A plugin that extends a service with new endpoints. This is the main trigger for this issue found integrating corepost into Scrapyd (www.scrapy.org).