I'm trying to detect for either of the following 2 options:
- A specific list of bots (FacebookExternalHit|LinkedInBot|TwitterBot|Baiduspider)
- Any bots that don't support the Crawable Ajax Specification
I've seen similar questions (How to recognize Facebook User-Agent) but nothing that explains how to do this in Node and Express.
I need to do this in a format like this:
app.get("*", function(req, res){
if (is one of the bots) //serve snapshot
if (is not one of the bots) res.sendFile(__dirname + "/public/index.html");
});