cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Approuter wildcard

kronseb
Participant

I use a custom approuter for my BTP application and I want to intercept myself before each request to /.../sap.

/appname/sap works. but I want to make a wildcard out of it. But /.*/sap does not work.

gregorw do you know if it is able to use regex as path in @sap/approuter npm package?

Willem_Pardaens
Product and Topic Expert
Product and Topic Expert
0 Kudos

Suggestion: I would try the forward-slash notation instead of string to define the regex, e.g.:

/\/(.*)\/sap/
View Entire Topic
Dinu
Contributor
0 Kudos

Middleware registration does not appear to support regex according to documentation:

Custom Middleware Injection

Mount middleware

But, you can always test in the handler.