Does any one success add express middleware in theia? #1379
Replies: 2 comments
-
| 
         Posted by: Hanksha on 9/15/2023, 7:46:21 AM Hi, I’ve done something similar, and this worked for me (I simplified the code): 
 I also bind a  Hope it helps!  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Posted by: zombie on 9/18/2023, 5:31:55 AM Hi, Hanksha Change the last line   | 
  
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted by: zombie on 9/14/2023, 10:24:30 AM
I’m building a web app for multy users with one or more theia-backend behind reverse proxy.
The use case is that user open theia app from web app A, before thiea app loads in browser, I want to intercept the request and make some authentication.I searched the community as well as github, find that BackendApplicationContribution provide hook to acheive this.
When I add my own middleware, the browser apps goes to 404.
Below is my code
I see https://github.com/eclipse-theia/theia/blob/master/packages/core/src/electron-node/token/electron-token-backend-contribution.ts use this hook, but my apps failed on this.
I also read this and this and this, none of them work.
Anyone helps? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions