Use regexes instead of prefix matching in middleware
Update .travis.yml