A middleware to perform text substitution on served resources.