I've been asked to make an app take in an optional first path segment and behave the same with/without it.
The app is a typical router-based lazy loaded angular app, and ideally I can implement some sort of middleware to allow the path to parse out the first segment( if it's a particular string, let's say 'foo') . I haven't found anything so far, but hoping something exists.
Example of desired behavior: the /foo would be optional and the router would only care about/implement the second set of routes (without /foo)
/foo/bar
/foo/bar/todo
/bar
/bar/todo