corepost icon indicating copy to clipboard operation
corepost copied to clipboard

Inheritance of service urls

Open llonchj opened this issue 11 years ago • 2 comments

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)

llonchj avatar Apr 24 '13 09:04 llonchj

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?

jacek99 avatar Apr 24 '13 16:04 jacek99

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).

llonchj avatar Apr 24 '13 23:04 llonchj