Update middlewares to work on the specified express without warnings.

With the current express pushd gives a lot of deprecated warnings, these changes should result in an identical behavior but with no warnings.