Saturday, 18 March 2017

Alter express routes from one "express capture" to another

In a number of PHP frameworks I've used in the past, there was the ability to match URLs (with or without variables) to a controller / action route.

For example:

/example/:action.:type => /other/:action.:type

This is helpful in some cases.

I was wondering if there was a clean / easy way to do this with express.

It feels like app.use() could be helpful, but the dancing around variables makes me cautious.

Anyone have experience with this?



via Gaunt Face