added code in middleware to merge configured urls for templates.