-2

I would like to create a server on node where users will request several pages from a static folder and the server should inject a custom tag on them before serving.

Is there any recommended way to do it? I've been trying with http-proxy with no luck, not sure if I really need a proxy or if there's a way to intercept the answer on static pages using just simple http.

1 Answers1

0

You will have to make an AJAX request to the server, which then will send you back the files. If everything goes right, then you can use .innerHTML = ... to inject it.

László Stahorszki
  • 1,102
  • 7
  • 23