I am trying to get Cheerio to work with Express. I'd like to be able to manipulate the dom from the server, but all I have found is web scraping..
There are some requirements..
At the moment, I am able to run multiple app.listen(port);
statements, and use multiple servers.
I'm trying to append <script>alert("test);</script>
to every single page sent by express.
I've created the express server: (Assuming Path
is a predefined variable)
var express = require('express');
var app = express();
app.get('/', function (req, res) {
app.use(app.static(Path));
res.sendFile(Path + "/index.html");
});
app.listen(Port);
Can you guys provide me with a working example to append this to the page. Is there a way to get this to work in real time?
Thanks!