Adding middleware code to inject JS into HTML response bodies