Jaymon / endpoints

Lightweight REST api backend framework that automatically maps urls to python modules and classes
MIT License
29 stars 10 forks source link

WebServer should be able to create a WebClient that can query it #93

Closed Jaymon closed 1 year ago

Jaymon commented 5 years ago

It's common when you start a webserver to not know the host until the webserver has started, so to create a client you would do something like:

c = WebClient(server.host)

But why can't the server just do that?

c = server.create_client()

This would also make it so you don't have to import endpoints.client.WebClient into your module

Jaymon commented 1 year ago

This is legit, but I've removed the server code in the new ASGI code, and the test servers would benefit from being able to create a controller but right now the tests pass using TestCase.create_client and I'm worn out on refactoring things right now.