How does requests work in Eclipse Theia?

Delving into BackendApplication it seems that we use Express.

I’m currently writing a method to serve GZIpped content on UAs that support gzip Content-Encoding, and I wonder if I should do a middleware approach to intercept the request, or something else.

A nice breakdown how Theia uses Express would be nice since I’m new to contributing in the internals for it.

[original thread by Ayane Satomi]

Simply write a BackendApplicationContribution with a configure(app: express.Application) method, and you should be good to go :slight_smile:

You can see an example in action:

Oh and yes, middleware approach sounds nice, just be careful with connection upgrade requests (when we connect websockets).
I don’t know much more about how we use the express server, just that we pretty much just serve static files (setup is in the generated sources for the applications), and that we open websocket connections.