runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Cannot register middleware (or configure) server on runtime/react

Open ash-m opened this issue 2 years ago • 0 comments

The runtime/react instantiates an HttpServer for you which is where one would define middleware. Can we abstract this in a decent way? Maybe we can add an optional $middlewares argument to getRunner().

Or something a bit more long-term for people that want to tweak it different ways, perhaps there's a way were we can just extend the ServerFactory to use an HttpServer we configure. Not sure how that would work though. Maybe replace new HttpServer with $this->getHttpServer(), return a new one by default, or whatever the user decided if we've registered that class somehow... perhaps as an option argument to getRunner().

ash-m avatar Apr 14 '23 22:04 ash-m