I am using CherryPy, and in my class I have a attribute suppliers, no I also want to have a URL path suppliers that requests that attribute, obviously that doesn't work. But how to "alias" that path to prevent a 404?
class MyServer(object):
def __init__(self, _suppliers):
self.suppliers = _suppliers
@cherrypy.expose
@cherrypy.tools.json_out()
def get_suppliers(self):
return self.suppliers
I tried expose(path="suppliers") and expose(alias="suppliers") but both don't work.
I am using CherryPy 18.8.0.